package com.turing.data.engine;

import com.alibaba.fastjson.JSONArray;
import com.turing.common.entity.SimpleParaInfoVO;
import com.turing.common.entity.TextVO;
import com.turing.data.vo.out.review.TaskElementVO;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class TextUtils {

    private static Log logger = LogFactory.getLog(TextUtils.class);


    /* 给前端用的方法，寻找原始字符串向前或向后扩展后的字符串
     * searchWords:需要扩展的词
     * text：来源文本
     * expandForward：向前扩展offset
     * expandBackward：向后扩展offset
     * */
    public static String expandTextLimit(String searchWords, String text, int expandForward, int expandBackward) {

        if (expandForward <= 0 || expandBackward <= 0 || searchWords.length() >= text.length()) {
            return searchWords;
        }

        String strForward;
        String strBackWord;

        int start = text.indexOf(searchWords);
        if (start >= expandForward) {
            strForward = text.substring(start - expandForward, start);
        } else {
            strForward = text.substring(0, start);
        }

        int end = start + searchWords.length() - 1;
        if (end < text.length() - expandBackward) {
            strBackWord = text.substring(end + 1, end + expandBackward + 1);
        } else {
            strBackWord = text.substring(end + 1);
        }

        return strForward + searchWords + strBackWord;

    }

    /**
     * 修正位置信息入口方法，根据文本的之间的相对位置选择合适的处理方法
     *
     * @param originalModelElement 原始的业务要素字符串
     * @param targetModelElement   目标业务要素字符串
     * @param nearByText           扩展后的字符串
     * @param drawResultVO         原始的段落信息对象
     * @param expandLimit          扩展的字数限制
     * @param fileTextStr          json文本string
     * @param rawText              raw_text文本
     * @return 目标文段信息对象
     */
    public static TaskElementVO.DrawResultVO correctingPositionInfo(String originalModelElement, String targetModelElement, String nearByText,
                                                                    TaskElementVO.DrawResultVO drawResultVO, int expandLimit,
                                                                    String fileTextStr, String rawText) {

        try {
            int originalStartIndex = nearByText.indexOf(originalModelElement);
            int originalEndIndex = originalStartIndex + originalModelElement.length();
            int targetStartIndex = nearByText.indexOf(targetModelElement);
            int targetEndIndex = targetStartIndex + targetModelElement.length();
            JSONArray fileTextArr = JSONArray.parseArray(fileTextStr);
            if (targetStartIndex <= originalStartIndex && targetEndIndex >= originalEndIndex) {
                return expandTextByCenter(drawResultVO, targetModelElement, expandLimit, fileTextArr, rawText);
            } else if (targetStartIndex >= originalStartIndex && targetEndIndex >= originalEndIndex) {
                return expandTextForward(drawResultVO, targetModelElement, expandLimit, fileTextArr, rawText);
            } else if (targetStartIndex <= originalStartIndex) {
                return expandTextBackward(drawResultVO, targetModelElement, expandLimit, fileTextArr, rawText);
            } else {
                return retractText(drawResultVO, targetModelElement, fileTextArr, rawText);
            }
        } catch (Exception e) {
            e.printStackTrace();
            return drawResultVO;
        }

    }

    /**
     * 从中间向两边扩展
     *
     * @param drawResultVO 原始的文段信息对象
     * @param targetText   目标文本
     * @param expandLimit  向两边扩展的字数限制
     * @param fileTextArr  json文本位置
     * @param rawText      raw_text文本
     * @return 目标文段信息对象
     */
    private static TaskElementVO.DrawResultVO expandTextByCenter(TaskElementVO.DrawResultVO drawResultVO, String targetText, int expandLimit, JSONArray fileTextArr, String rawText) {
        //String jsonStr = "[{\"startLineNo\":\"37\",\"cus_sample_id\":\"7ab8b3fd-6fe3-45d7-8251-2f9e033d723c\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_249_765\",\"start\":24247,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"43\",\"global_pos\":[24247,24331],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_37_xEyYXwgn6ee0\",\"line_31_39_xGyYXwgn8808\",\"line_31_41_xIyYXwgn0ef8\",\"line_31_43_xKyYXwgne816\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,6],\"end\":24331,\"page\":\"31\",\"text\":\"11.2.2 估值方法（1）在交易所上市交易或挂牌转让的固定收益品种，采用中证指数有限公司提供的估值价确定公允价值，在估值技术难以可靠计量公允价值的情况下，按成本估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"44\",\"cus_sample_id\":\"e8a99ea0-e897-493a-b19e-5b94d7338472\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_250_766\",\"start\":24331,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"46\",\"global_pos\":[24331,24388],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_44_xLyYXwgn96e3\",\"line_31_46_xNyYXwgn9680\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,25],\"end\":24388,\"page\":\"31\",\"text\":\"（2）全国银行间债券市场交易的债券、资产支持证券等固定收益品种，采用中央国债登记结算公司提供的估值价确定公允价值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"47\",\"cus_sample_id\":\"25c802f9-232a-46a0-ac76-5c5324b2b47e\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_251_767\",\"start\":24388,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"49\",\"global_pos\":[24388,24424],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_47_xOyYXwgne081\",\"line_31_49_xQyYXwgne2ee\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,4],\"end\":24424,\"page\":\"31\",\"text\":\"（3）同一债券同时在两个或两个以上市场交易的，按债券所处的市场分别估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"50\",\"cus_sample_id\":\"a09a7563-fe04-4516-9c71-2bae4a575623\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_252_768\",\"start\":24424,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"4\",\"global_pos\":[24424,24547],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_50_xRyYXwgn5017\",\"line_31_51_xSyYXwgn66e8\",\"line_31_53_xUyYXwgne8f8\",\"line_32_0_xWyYXwgn017e\",\"line_32_2_xYyYXwgn08a1\",\"line_32_4_xayYXwgn0fee\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,17],\"end\":24547,\"page\":\"31\",\"text\":\"（4）证券投资基金的估值A、开放式基金（包括托管在场外的上市开放式基金 LOF）以估值日前一32创金合信汇盈 101 号资产管理计划资产管理合同交易日基金净值估值，估值日前一交易日开放式基金份额净值未公布的，以此前最近一个交易日基金份额净值计算。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"5\",\"cus_sample_id\":\"6b223080-3460-4b8f-9cf0-49c7821e17e2\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_253_769\",\"start\":24547,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"8\",\"global_pos\":[24547,24632],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_5_xbyYXwgn561e\",\"line_32_7_xdyYXwgne979\",\"line_32_8_xeyYXwgnee60\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,30],\"end\":24632,\"page\":\"32\",\"text\":\"B、上市流通的证券投资基金按估值日其所在证券交易所的收盘价估值；估值日无交易的，以最近一个交易日的收盘价估值；C、货币基金以成本估值，每日按前一交易日的万份收益计提红利。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"20\",\"cus_sample_id\":\"bdacc7f3-085a-4680-b7fc-a5a5f8a42c7c\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_258_774\",\"start\":24840,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"24\",\"global_pos\":[24840,24910],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_20_xqyYXwgned16\",\"line_32_22_xsyYXwgna102\",\"line_32_24_xuyYXwgn9616\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,3],\"end\":24910,\"page\":\"32\",\"text\":\"（9）如有确凿证据表明按上述方法进行估值不能客观反映其公允价值的，资产管理人可根据具体情况与资产托管人商定后，按最能反映公允价值的价格估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"25\",\"cus_sample_id\":\"89ae33fa-c8a0-4a35-995d-50d1013336cf\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_260_776\",\"start\":24938,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"27\",\"global_pos\":[24938,24955],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_25_xvyYXwgnf201\",\"line_32_27_xxyYXwgn119a\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[28,12],\"end\":24955,\"page\":\"32\",\"text\":\"如有新增事项，按国家最新规定估值。\",\"category\":\"资产管理计划的估值方法\"}]";
        //List<ParaInfoVO> paraInfoVOS = JSONArray.parseArray(jsonStr,ParaInfoVO.class);
        //ParaInfoVO paraInfoVO = paraInfoVOS.get(paraInfoVOS.size()-1);
        TaskElementVO.DrawResultVO target;
        target = drawResultVO;
        List<Integer> global_pos = drawResultVO.getGlobal_pos();
        List<String> paraInfos = drawResultVO.getPara_info();
        int startLineNo = drawResultVO.getStartLineNo();
        int endLineNo = drawResultVO.getEndLineNo();
        List<Integer> pos_info = drawResultVO.getPos_info();
        //String OCR_JSON_PATH = "D:\\创金合信汇盈101号资产管理计划资产管理合同 (1).json";
        //String rawPath = "D:\\创金合信汇盈101号资产管理计划资产管理合同 (1)_raw.txt";
        //String rawText = FileUtils.readFile(rawPath);
        //JSONArray fileTextArr = FileUtils.transOCRJsonArr( OCR_JSON_PATH );

        List<TextVO> textVOS = JSONArray.parseArray(fileTextArr.toJSONString(), TextVO.class);

        //获取全部文本
        //String targetText = "A、开放式基金（包括托管在场外的上市开放式基金 LOF）以估值日前一32创金合信汇盈 101 号资产管理计划资产管理合同交易日基金净值估值，估值日前一交易日开放式基金份额净值未公布的，以此前最近一个交易日基金份额净值计算。B、上市流通的证券投资基金按估值日其所在证券交易所的收盘价估值；估值日无交易的，以最近一个交易日的收盘价估值；C、货币基金以成本估值，每日按前一交易日的万份收益计提红利。（5）银行存款（活期、定期）及证券资金账户存款按照约定利率在持有期内逐日计提应收利息，在利息到账日以实收利息入账。（6）债券回购和具有固定回报的买入返售金融资产：以买入/外放成本列示，按约定收益率逐日计提收益/成本。（7）期货以估值日期期货交易所的当日结算价估值，该日无交易的，以最近一日的当日结算价为准。（8）利率互换交易（IRS）选取本计划聘请的上清所综合结算会员人民币利率互换集中清算业务代理清算结果进行估值。（9）如有确凿证据表明按上述方法进行估值不能客观反映其公允价值的，资产管理人可根据具体情况与资产托管人商定后，按最能反映公允价值的价格估值。（10）相关法律法规以及监管部门有强制规定的，从其规定。如有新增事项，按国家最新规定估值。";
        targetText = targetText.replaceAll("\n", "");
        List<Integer> targetPosInfo = drawResultVO.getPos_info();
        List<Integer> targetGlobalPos = new ArrayList<>();
        List<String> targetParaInfos = drawResultVO.getPara_info();
        target.setGlobal_pos(targetGlobalPos);

        int startPos = global_pos.get(0);
        int endPos = global_pos.get(1);
        int expandOffSet = 0;
        String expandText = "";

        //两边加一个字去匹配，记录增加的字数
        while (expandOffSet < expandLimit && startPos < expandOffSet && rawText.length() < endPos + expandOffSet) {
            expandOffSet++;
            String substring = rawText.substring(startPos - expandOffSet, endPos + expandOffSet);
            if (substring.contains(targetText)) {
                expandText = substring;
                break;
            }
        }

        //定位全部文本位置，剪去不要的
        int startIndex = expandText.indexOf(targetText);
        int offsetLeft = expandOffSet - startIndex;
        int offsetRight = expandOffSet - (expandText.length() - targetText.length() - startIndex);
        target.setStart(startPos - offsetLeft);
        target.setEnd(endPos + offsetRight);
        target.setText(rawText.substring(startPos - offsetLeft, endPos + offsetRight));
        targetGlobalPos.add(startPos - offsetLeft);
        targetGlobalPos.add(endPos + offsetRight);

        //查看当前行有多少空余位
        String[] startParaInfo = paraInfos.get(0).split("_");
        String[] endParaInfo = paraInfos.get(paraInfos.size() - 1).split("_");
        int startPageNo = Integer.parseInt(startParaInfo[1]);
        int endPageNo = Integer.parseInt(endParaInfo[1]);
        TextVO startPage = textVOS.get(startPageNo);
        TextVO endPage = textVOS.get(endPageNo);
        TextVO.Line startLine = startPage.getParagraphs().get(0).getLines().get(startLineNo);
        TextVO.Line endLine = endPage.getParagraphs().get(0).getLines().get(endLineNo);
        int startRemaining = pos_info.get(0);
        int endRemaining = endLine.getObjContent().length() - pos_info.get(1);
        int total = 0;

        //遍历所有能够到达的空余位并占有
        SimpleParaInfoVO startParaInfoVO = movePositionBackward(startPageNo, startLineNo, textVOS, offsetLeft, startRemaining);

        if (startParaInfoVO.getPosNO() == 0) {
            startParaInfoVO = movePositionBackward(startParaInfoVO.getPageNO(), startParaInfoVO.getLineNO(),
                    textVOS, 1, 0);
            startParaInfoVO.setPosNO(startParaInfoVO.getPosNO() + 1);
        }
        target.setStartLineNo(startParaInfoVO.getLineNO());
        //targetParaInfos.set(0,startParaInfoVO.getLineId());
        targetPosInfo.set(0, startParaInfoVO.getPosNO());
        target.setPage(startParaInfoVO.getPageNO());

        int endTotal = 0;
        //System.out.println("total:"+total);
        SimpleParaInfoVO endParaInfoVO = movePositionForward(endPageNo, endLineNo, textVOS, offsetRight, endRemaining);
        targetParaInfos = getRangeParaInfos(startParaInfoVO.getLineId(), endParaInfoVO.getLineId(), textVOS);
        target.setEndLineNo(endParaInfoVO.getLineNO());
        //targetParaInfos.set(1,endParaInfoVO.getLineId());
        targetPosInfo.set(1, endParaInfoVO.getPosNO());

        //System.out.println("endTotal:"+endTotal);
        target.setPos_info(targetPosInfo);
        target.setGlobal_pos(targetGlobalPos);
        target.setPara_info(targetParaInfos);
        //paraInfoVOS.set(paraInfoVOS.size()-1,target);
        return target;
    }

    /**
     * 向后单向扩展
     *
     * @param drawResultVO 原始的文段信息对象
     * @param targetText   目标文本
     * @param expandLimit  向后扩展的字数限制
     * @param fileTextArr  json文本位置
     * @param rawText      raw_text文本
     * @return 目标文段信息对象
     */
    private static TaskElementVO.DrawResultVO expandTextForward(TaskElementVO.DrawResultVO drawResultVO, String targetText, int expandLimit, JSONArray fileTextArr, String rawText) {

        //String jsonStr = "[{\"startLineNo\":\"37\",\"cus_sample_id\":\"7ab8b3fd-6fe3-45d7-8251-2f9e033d723c\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_249_765\",\"start\":24247,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"43\",\"global_pos\":[24247,24331],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_37_xEyYXwgn6ee0\",\"line_31_39_xGyYXwgn8808\",\"line_31_41_xIyYXwgn0ef8\",\"line_31_43_xKyYXwgne816\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,6],\"end\":24331,\"page\":\"31\",\"text\":\"11.2.2 估值方法（1）在交易所上市交易或挂牌转让的固定收益品种，采用中证指数有限公司提供的估值价确定公允价值，在估值技术难以可靠计量公允价值的情况下，按成本估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"44\",\"cus_sample_id\":\"e8a99ea0-e897-493a-b19e-5b94d7338472\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_250_766\",\"start\":24331,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"46\",\"global_pos\":[24331,24388],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_44_xLyYXwgn96e3\",\"line_31_46_xNyYXwgn9680\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,25],\"end\":24388,\"page\":\"31\",\"text\":\"（2）全国银行间债券市场交易的债券、资产支持证券等固定收益品种，采用中央国债登记结算公司提供的估值价确定公允价值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"47\",\"cus_sample_id\":\"25c802f9-232a-46a0-ac76-5c5324b2b47e\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_251_767\",\"start\":24388,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"49\",\"global_pos\":[24388,24424],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_47_xOyYXwgne081\",\"line_31_49_xQyYXwgne2ee\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,4],\"end\":24424,\"page\":\"31\",\"text\":\"（3）同一债券同时在两个或两个以上市场交易的，按债券所处的市场分别估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"50\",\"cus_sample_id\":\"a09a7563-fe04-4516-9c71-2bae4a575623\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_252_768\",\"start\":24424,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"4\",\"global_pos\":[24424,24547],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_50_xRyYXwgn5017\",\"line_31_51_xSyYXwgn66e8\",\"line_31_53_xUyYXwgne8f8\",\"line_32_0_xWyYXwgn017e\",\"line_32_2_xYyYXwgn08a1\",\"line_32_4_xayYXwgn0fee\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,17],\"end\":24547,\"page\":\"31\",\"text\":\"（4）证券投资基金的估值A、开放式基金（包括托管在场外的上市开放式基金 LOF）以估值日前一32创金合信汇盈 101 号资产管理计划资产管理合同交易日基金净值估值，估值日前一交易日开放式基金份额净值未公布的，以此前最近一个交易日基金份额净值计算。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"5\",\"cus_sample_id\":\"6b223080-3460-4b8f-9cf0-49c7821e17e2\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_253_769\",\"start\":24547,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"8\",\"global_pos\":[24547,24632],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_5_xbyYXwgn561e\",\"line_32_7_xdyYXwgne979\",\"line_32_8_xeyYXwgnee60\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,30],\"end\":24632,\"page\":\"32\",\"text\":\"B、上市流通的证券投资基金按估值日其所在证券交易所的收盘价估值；估值日无交易的，以最近一个交易日的收盘价估值；C、货币基金以成本估值，每日按前一交易日的万份收益计提红利。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"20\",\"cus_sample_id\":\"bdacc7f3-085a-4680-b7fc-a5a5f8a42c7c\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_258_774\",\"start\":24840,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"24\",\"global_pos\":[24840,24910],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_20_xqyYXwgned16\",\"line_32_22_xsyYXwgna102\",\"line_32_24_xuyYXwgn9616\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,3],\"end\":24910,\"page\":\"32\",\"text\":\"（9）如有确凿证据表明按上述方法进行估值不能客观反映其公允价值的，资产管理人可根据具体情况与资产托管人商定后，按最能反映公允价值的价格估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"25\",\"cus_sample_id\":\"89ae33fa-c8a0-4a35-995d-50d1013336cf\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_260_776\",\"start\":24938,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"27\",\"global_pos\":[24938,24955],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_25_xvyYXwgnf201\",\"line_32_27_xxyYXwgn119a\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[28,12],\"end\":24955,\"page\":\"32\",\"text\":\"如有新增事项，按国家最新规定估值。\",\"category\":\"资产管理计划的估值方法\"}]";
        //List<ParaInfoVO> paraInfoVOS = JSONArray.parseArray(jsonStr,ParaInfoVO.class);
        //ParaInfoVO paraInfoVO = paraInfoVOS.get(paraInfoVOS.size()-1);
        TaskElementVO.DrawResultVO target;
        target = drawResultVO;
        List<Integer> global_pos = drawResultVO.getGlobal_pos();
        List<String> paraInfos = drawResultVO.getPara_info();
        int startLineNo = drawResultVO.getStartLineNo();
        int endLineNo = drawResultVO.getEndLineNo();
        List<Integer> pos_info = drawResultVO.getPos_info();
        //String OCR_JSON_PATH = "D:\\创金合信汇盈101号资产管理计划资产管理合同 (1).json";
        //String rawPath = "D:\\创金合信汇盈101号资产管理计划资产管理合同 (1)_raw.txt";
        //String rawText = FileUtils.readFile(rawPath);
        //JSONArray fileTextArr = FileUtils.transOCRJsonArr( OCR_JSON_PATH );
        List<TextVO> textVOS = JSONArray.parseArray(fileTextArr.toJSONString(), TextVO.class);

        //获取全部文本
        /*String targetText = "托管人应定期与资产管理人就委托财产的会计核算、报表编制\n" +
                "等进行核对。\n" +
                "34创金合信汇盈 101 号资产管理计划资产管理合同\n" +
                "十二、资产托管人对资产管理人的投资监督\n" +
                "12.1 资产托管人对资产管理人的投资行为行使监督权\n" +
                "12.1.1 资产托管人根据合同的约定，对下述资产投资";*/
        targetText = targetText.replaceAll("\n", "");
        List<Integer> targetPosInfo = drawResultVO.getPos_info();
        List<Integer> targetGlobalPos = new ArrayList<>();
        List<String> targetParaInfos = new ArrayList<>();
        target.setGlobal_pos(targetGlobalPos);

        int startPos = global_pos.get(0);
        int endPos = global_pos.get(1);
        int expandOffSet = 0;
        String expandText = "";

        //加一个字去匹配，记录增加的字数
        while (expandOffSet < expandLimit && rawText.length() > endPos + expandOffSet) {
            expandOffSet++;
            String substring = rawText.substring(startPos, endPos + expandOffSet);
            if (substring.contains(targetText)) {
                expandText = substring;
                break;
            }
        }

        //定位全部文本位置，剪去不要的
        int startIndex = expandText.indexOf(targetText);
        int endOffset = expandOffSet;
        target.setStart(startPos + startIndex);
        target.setEnd(endPos + expandOffSet);
        target.setText(rawText.substring(startPos + startIndex, endPos + expandOffSet));
        targetGlobalPos.add(startPos + startIndex);
        targetGlobalPos.add(endPos + expandOffSet);

        //查看当前行有多少空余位
        String[] startParaInfo = paraInfos.get(0).split("_");
        String[] endParaInfo = paraInfos.get(paraInfos.size() - 1).split("_");
        int startPageNo = Integer.parseInt(startParaInfo[1]);
        int endPageNo = Integer.parseInt(endParaInfo[1]);
        TextVO startPage = textVOS.get(startPageNo);
        TextVO endPage = textVOS.get(endPageNo);
        TextVO.Line startLine = startPage.getParagraphs().get(0).getLines().get(startLineNo);
        TextVO.Line endLine = endPage.getParagraphs().get(0).getLines().get(endLineNo);
        int startRemaining = startLine.getObjContent().length() - pos_info.get(0);
        int endRemaining = endLine.getObjContent().length() - pos_info.get(1);

        SimpleParaInfoVO startParaInfoVO = movePositionForward(startPageNo, startLineNo, textVOS, startIndex, startRemaining);
        target.setStartLineNo(startParaInfoVO.getLineNO());
        target.setPage(startParaInfoVO.getPageNO());
        //targetParaInfos.add(startParaInfoVO.getLineId());
        targetPosInfo.set(0, startParaInfoVO.getPosNO());

        SimpleParaInfoVO endParaInfoVO = movePositionForward(endPageNo, endLineNo, textVOS, endOffset, endRemaining);
        target.setEndLineNo(endParaInfoVO.getLineNO());
        targetParaInfos = getRangeParaInfos(startParaInfoVO.getLineId(), endParaInfoVO.getLineId(), textVOS);
        targetPosInfo.set(1, endParaInfoVO.getPosNO());

        target.setPos_info(targetPosInfo);
        target.setGlobal_pos(targetGlobalPos);
        target.setPara_info(targetParaInfos);
        //paraInfoVOS.set(paraInfoVOS.size()-1,target);
        return target;

    }

    /**
     * 向前单向扩展
     *
     * @param drawResultVO 原始的文段信息对象
     * @param targetText   目标文本
     * @param expandLimit  向前扩展的字数限制
     * @param fileTextArr  json文本位置
     * @param rawText      raw_text文本
     * @return 目标文段信息对象
     */
    private static TaskElementVO.DrawResultVO expandTextBackward(TaskElementVO.DrawResultVO drawResultVO, String targetText, int expandLimit, JSONArray fileTextArr, String rawText) {
        //String jsonStr = "[{\"startLineNo\":\"37\",\"cus_sample_id\":\"7ab8b3fd-6fe3-45d7-8251-2f9e033d723c\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_249_765\",\"start\":24247,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"43\",\"global_pos\":[24247,24331],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_37_xEyYXwgn6ee0\",\"line_31_39_xGyYXwgn8808\",\"line_31_41_xIyYXwgn0ef8\",\"line_31_43_xKyYXwgne816\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,6],\"end\":24331,\"page\":\"31\",\"text\":\"11.2.2 估值方法（1）在交易所上市交易或挂牌转让的固定收益品种，采用中证指数有限公司提供的估值价确定公允价值，在估值技术难以可靠计量公允价值的情况下，按成本估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"44\",\"cus_sample_id\":\"e8a99ea0-e897-493a-b19e-5b94d7338472\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_250_766\",\"start\":24331,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"46\",\"global_pos\":[24331,24388],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_44_xLyYXwgn96e3\",\"line_31_46_xNyYXwgn9680\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,25],\"end\":24388,\"page\":\"31\",\"text\":\"（2）全国银行间债券市场交易的债券、资产支持证券等固定收益品种，采用中央国债登记结算公司提供的估值价确定公允价值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"47\",\"cus_sample_id\":\"25c802f9-232a-46a0-ac76-5c5324b2b47e\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_251_767\",\"start\":24388,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"49\",\"global_pos\":[24388,24424],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_47_xOyYXwgne081\",\"line_31_49_xQyYXwgne2ee\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,4],\"end\":24424,\"page\":\"31\",\"text\":\"（3）同一债券同时在两个或两个以上市场交易的，按债券所处的市场分别估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"50\",\"cus_sample_id\":\"a09a7563-fe04-4516-9c71-2bae4a575623\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_252_768\",\"start\":24424,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"4\",\"global_pos\":[24424,24547],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_50_xRyYXwgn5017\",\"line_31_51_xSyYXwgn66e8\",\"line_31_53_xUyYXwgne8f8\",\"line_32_0_xWyYXwgn017e\",\"line_32_2_xYyYXwgn08a1\",\"line_32_4_xayYXwgn0fee\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,17],\"end\":24547,\"page\":\"31\",\"text\":\"（4）证券投资基金的估值A、开放式基金（包括托管在场外的上市开放式基金 LOF）以估值日前一32创金合信汇盈 101 号资产管理计划资产管理合同交易日基金净值估值，估值日前一交易日开放式基金份额净值未公布的，以此前最近一个交易日基金份额净值计算。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"5\",\"cus_sample_id\":\"6b223080-3460-4b8f-9cf0-49c7821e17e2\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_253_769\",\"start\":24547,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"8\",\"global_pos\":[24547,24632],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_5_xbyYXwgn561e\",\"line_32_7_xdyYXwgne979\",\"line_32_8_xeyYXwgnee60\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,30],\"end\":24632,\"page\":\"32\",\"text\":\"B、上市流通的证券投资基金按估值日其所在证券交易所的收盘价估值；估值日无交易的，以最近一个交易日的收盘价估值；C、货币基金以成本估值，每日按前一交易日的万份收益计提红利。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"20\",\"cus_sample_id\":\"bdacc7f3-085a-4680-b7fc-a5a5f8a42c7c\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_258_774\",\"start\":24840,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"24\",\"global_pos\":[24840,24910],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_20_xqyYXwgned16\",\"line_32_22_xsyYXwgna102\",\"line_32_24_xuyYXwgn9616\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,3],\"end\":24910,\"page\":\"32\",\"text\":\"（9）如有确凿证据表明按上述方法进行估值不能客观反映其公允价值的，资产管理人可根据具体情况与资产托管人商定后，按最能反映公允价值的价格估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"25\",\"cus_sample_id\":\"89ae33fa-c8a0-4a35-995d-50d1013336cf\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_260_776\",\"start\":24938,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"27\",\"global_pos\":[24938,24955],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_25_xvyYXwgnf201\",\"line_32_27_xxyYXwgn119a\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[28,12],\"end\":24955,\"page\":\"32\",\"text\":\"如有新增事项，按国家最新规定估值。\",\"category\":\"资产管理计划的估值方法\"}]";
        //List<ParaInfoVO> paraInfoVOS = JSONArray.parseArray(jsonStr,ParaInfoVO.class);
        //ParaInfoVO paraInfoVO = paraInfoVOS.get(paraInfoVOS.size()-1);
        TaskElementVO.DrawResultVO target;
        target = drawResultVO;
        String category = "资产管理计划的估值方法";
        String text = drawResultVO.getText();
        String cus_sample_id = drawResultVO.getSample_id();
        int start = drawResultVO.getStart();
        int end = drawResultVO.getEnd();
        List<Integer> global_pos = drawResultVO.getGlobal_pos();
        List<String> paraInfos = drawResultVO.getPara_info();
        int page = drawResultVO.getPage();
        int startLineNo = drawResultVO.getStartLineNo();
        int endLineNo = drawResultVO.getEndLineNo();
        int lineNo = drawResultVO.getLineNo();
        List<Integer> pos_info = drawResultVO.getPos_info();
        //String OCR_JSON_PATH = "D:\\创金合信汇盈101号资产管理计划资产管理合同 (1).json";
        //String rawPath = "D:\\创金合信汇盈101号资产管理计划资产管理合同 (1)_raw.txt";
        //String rawText = FileUtils.readFile(rawPath);
        //JSONArray fileTextArr = FileUtils.transOCRJsonArr( OCR_JSON_PATH );
        //System.out.println(fileTextArr);
        List<TextVO> textVOS = JSONArray.parseArray(fileTextArr.toJSONString(), TextVO.class);

        //获取全部文本
        //String targetText = "相关法律法规以及监管部门有强制规定的，从其规定。如有新增事项，按国家最新规定估值。";
        /*String targetText = "互换交易（IRS）选取本计划聘请的上清所综合结算会员人民币\n" +
                "利率互换集中清算业务代理清算结果进行估值。\n" +
                "（9）如有确凿证据表明按上述方法进行估值不能客观反映其公允价值的，\n" +
                "资产管理人可根据具体情况与资产托管人商定后，按最能反映公允价值的价格\n" +
                "估值。\n" +
                "（10）相关法律法规以及监管部门有强制规定的，从其规定。如有新增事\n" +
                "项";*/
        targetText = targetText.replaceAll("\n", "");
        List<Integer> targetPosInfo = drawResultVO.getPos_info();
        int targetStart;
        int targetEnd;
        int targetPage;
        int targetStartLineNo;
        int targetEndLineNo;
        List<Integer> targetGlobalPos = new ArrayList<>();
        List<String> targetParaInfos = new ArrayList<>();
        target.setGlobal_pos(targetGlobalPos);
        //获取模型文本
        String modelText = rawText.substring(global_pos.get(0), global_pos.get(1));

        int startPos = global_pos.get(0);
        int endPos = global_pos.get(1);
        int expandOffSet = 0;

        //左边加一个字去匹配，记录增加的字数
        while (expandOffSet < expandLimit && startPos >= expandOffSet) {
            expandOffSet++;
            String substring = rawText.substring(startPos - expandOffSet, endPos);
            if (substring.contains(targetText)) {
                break;
            }
        }

        //定位全部文本位置，剪去不要的
        int offsetLeft1 = expandOffSet;
        int offsetLeft2 = expandOffSet + endPos - startPos - targetText.length();
        target.setStart(startPos - expandOffSet);
        target.setEnd(endPos - offsetLeft2);
        target.setText(rawText.substring(startPos - expandOffSet, endPos - offsetLeft2));
        targetGlobalPos.add(startPos - expandOffSet);
        targetGlobalPos.add(endPos - offsetLeft2);

        //查看当前行有多少空余位
        String[] startParaInfo = paraInfos.get(0).split("_");
        String[] endParaInfo = paraInfos.get(paraInfos.size() - 1).split("_");
        int startPageNo = Integer.parseInt(startParaInfo[1]);
        int endPageNo = Integer.parseInt(endParaInfo[1]);
        TextVO startPage = textVOS.get(startPageNo);
        TextVO endPage = textVOS.get(endPageNo);
        TextVO.Line startLine = startPage.getParagraphs().get(0).getLines().get(startLineNo);
        TextVO.Line endLine = endPage.getParagraphs().get(0).getLines().get(endLineNo);
        int startRemaining = pos_info.get(0);
        int endRemaining = pos_info.get(1);
        int total = 0;

        SimpleParaInfoVO startParaInfoVO = movePositionBackward(startPageNo, startLineNo, textVOS, offsetLeft1, startRemaining);
        target.setStartLineNo(startParaInfoVO.getLineNO());
        //targetParaInfos.add(startParaInfoVO.getLineId());
        targetPosInfo.set(0, startParaInfoVO.getPosNO());
        target.setPage(startParaInfoVO.getPageNO());

        SimpleParaInfoVO endParaInfoVO = movePositionBackward(endPageNo, endLineNo, textVOS, offsetLeft2, endRemaining);
        if (endParaInfoVO.getPosNO() == 0) {
            endParaInfoVO = movePositionBackward(endParaInfoVO.getPageNO(), endParaInfoVO.getLineNO(),
                    textVOS, 1, 0);
            endParaInfoVO.setPosNO(endParaInfoVO.getPosNO() + 1);
        }
        targetParaInfos = getRangeParaInfos(startParaInfoVO.getLineId(), endParaInfoVO.getLineId(), textVOS);
        target.setEndLineNo(endParaInfoVO.getLineNO());

        targetPosInfo.set(1, endParaInfoVO.getPosNO());

        //System.out.println(total);
        int endTotal = 0;

        //System.out.println("endTotal:"+endTotal);
        target.setPos_info(targetPosInfo);
        target.setGlobal_pos(targetGlobalPos);
        target.setPara_info(targetParaInfos);
        //System.out.println("target:--------------------------------------"+target);
        return target;

    }

    /**
     * 向内缩小
     *
     * @param drawResultVO 原始的文段信息对象
     * @param targetText   目标文本
     * @param fileTextArr  json文本位置
     * @param rawText      raw_text文本
     * @return 目标文段信息对象
     */
    private static TaskElementVO.DrawResultVO retractText(TaskElementVO.DrawResultVO drawResultVO, String targetText, JSONArray fileTextArr, String rawText) {

        //String jsonStr = "[{\"startLineNo\":\"37\",\"cus_sample_id\":\"7ab8b3fd-6fe3-45d7-8251-2f9e033d723c\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_249_765\",\"start\":24247,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"43\",\"global_pos\":[24247,24331],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_37_xEyYXwgn6ee0\",\"line_31_39_xGyYXwgn8808\",\"line_31_41_xIyYXwgn0ef8\",\"line_31_43_xKyYXwgne816\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,6],\"end\":24331,\"page\":\"31\",\"text\":\"11.2.2 估值方法（1）在交易所上市交易或挂牌转让的固定收益品种，采用中证指数有限公司提供的估值价确定公允价值，在估值技术难以可靠计量公允价值的情况下，按成本估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"44\",\"cus_sample_id\":\"e8a99ea0-e897-493a-b19e-5b94d7338472\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_250_766\",\"start\":24331,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"46\",\"global_pos\":[24331,24388],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_44_xLyYXwgn96e3\",\"line_31_46_xNyYXwgn9680\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,25],\"end\":24388,\"page\":\"31\",\"text\":\"（2）全国银行间债券市场交易的债券、资产支持证券等固定收益品种，采用中央国债登记结算公司提供的估值价确定公允价值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"47\",\"cus_sample_id\":\"25c802f9-232a-46a0-ac76-5c5324b2b47e\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_251_767\",\"start\":24388,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"49\",\"global_pos\":[24388,24424],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_47_xOyYXwgne081\",\"line_31_49_xQyYXwgne2ee\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,4],\"end\":24424,\"page\":\"31\",\"text\":\"（3）同一债券同时在两个或两个以上市场交易的，按债券所处的市场分别估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"50\",\"cus_sample_id\":\"a09a7563-fe04-4516-9c71-2bae4a575623\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_252_768\",\"start\":24424,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"4\",\"global_pos\":[24424,24547],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_31_50_xRyYXwgn5017\",\"line_31_51_xSyYXwgn66e8\",\"line_31_53_xUyYXwgne8f8\",\"line_32_0_xWyYXwgn017e\",\"line_32_2_xYyYXwgn08a1\",\"line_32_4_xayYXwgn0fee\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,17],\"end\":24547,\"page\":\"31\",\"text\":\"（4）证券投资基金的估值A、开放式基金（包括托管在场外的上市开放式基金 LOF）以估值日前一32创金合信汇盈 101 号资产管理计划资产管理合同交易日基金净值估值，估值日前一交易日开放式基金份额净值未公布的，以此前最近一个交易日基金份额净值计算。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"5\",\"cus_sample_id\":\"6b223080-3460-4b8f-9cf0-49c7821e17e2\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_253_769\",\"start\":24547,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"8\",\"global_pos\":[24547,24632],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_5_xbyYXwgn561e\",\"line_32_7_xdyYXwgne979\",\"line_32_8_xeyYXwgnee60\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,30],\"end\":24632,\"page\":\"32\",\"text\":\"B、上市流通的证券投资基金按估值日其所在证券交易所的收盘价估值；估值日无交易的，以最近一个交易日的收盘价估值；C、货币基金以成本估值，每日按前一交易日的万份收益计提红利。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"20\",\"cus_sample_id\":\"bdacc7f3-085a-4680-b7fc-a5a5f8a42c7c\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_258_774\",\"start\":24840,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"24\",\"global_pos\":[24840,24910],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_20_xqyYXwgned16\",\"line_32_22_xsyYXwgna102\",\"line_32_24_xuyYXwgn9616\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[0,3],\"end\":24910,\"page\":\"32\",\"text\":\"（9）如有确凿证据表明按上述方法进行估值不能客观反映其公允价值的，资产管理人可根据具体情况与资产托管人商定后，按最能反映公允价值的价格估值。\",\"category\":\"资产管理计划的估值方法\"},{\"startLineNo\":\"25\",\"cus_sample_id\":\"89ae33fa-c8a0-4a35-995d-50d1013336cf\",\"sample_id\":\"创金合信汇盈101号资产管理计划资产管理合同 (1)_260_776\",\"start\":24938,\"degree\":\"0.14285714285714285\",\"endLineNo\":\"27\",\"global_pos\":[24938,24955],\"lineNo\":0,\"pos\":[],\"para_info\":[\"line_32_25_xvyYXwgnf201\",\"line_32_27_xxyYXwgn119a\"],\"parentTaskSn\":\"44a91a75-825f-4d37-8428-f014173be39b\",\"context\":\"\",\"pos_info\":[28,12],\"end\":24955,\"page\":\"32\",\"text\":\"如有新增事项，按国家最新规定估值。\",\"category\":\"资产管理计划的估值方法\"}]";
        //List<ParaInfoVO> paraInfoVOS = JSONArray.parseArray(jsonStr,ParaInfoVO.class);
        //ParaInfoVO paraInfoVO = paraInfoVOS.get(paraInfoVOS.size()-1);
        TaskElementVO.DrawResultVO target;
        target = drawResultVO;
        List<Integer> global_pos = drawResultVO.getGlobal_pos();
        List<String> paraInfos = drawResultVO.getPara_info();
        int startLineNo = drawResultVO.getStartLineNo();
        int endLineNo = drawResultVO.getEndLineNo();
        List<Integer> pos_info = drawResultVO.getPos_info();
        //String OCR_JSON_PATH = "D:\\创金合信汇盈101号资产管理计划资产管理合同 (1).json";
        //String rawPath = "D:\\创金合信汇盈101号资产管理计划资产管理合同 (1)_raw.txt";
        //String rawText = FileUtils.readFile(rawPath);
        //JSONArray fileTextArr = FileUtils.transOCRJsonArr( OCR_JSON_PATH );
        //JSONArray fileTextArr = FileUtils.transOCRJsonArr( OCR_JSON_PATH );
        List<TextVO> textVOS = JSONArray.parseArray(fileTextArr.toJSONString(), TextVO.class);

        //获取全部文本
        //String targetText = "新增事项，按国家";
        String originalText = drawResultVO.getText();
        targetText = targetText.replaceAll("\n", "");
        List<Integer> targetPosInfo = drawResultVO.getPos_info();
        List<Integer> targetGlobalPos = new ArrayList<>();
        List<String> targetParaInfos = drawResultVO.getPara_info();
        target.setGlobal_pos(targetGlobalPos);

        int startPos = global_pos.get(0);
        int endPos = global_pos.get(1);
        int retractOffSet = 0;

        //定位全部文本位置，剪去不要的
        int offsetLeft = originalText.indexOf(targetText);
        int offsetRight = originalText.length() - targetText.length() - offsetLeft;
        target.setStart(startPos + offsetLeft);
        target.setEnd(endPos - offsetRight);
        target.setText(rawText.substring(startPos + offsetLeft, endPos - offsetRight));
        targetGlobalPos.add(startPos + offsetLeft);
        targetGlobalPos.add(endPos - offsetRight);

        //查看当前行有多少空余位
        String[] startParaInfo = paraInfos.get(0).split("_");
        String[] endParaInfo = paraInfos.get(paraInfos.size() - 1).split("_");
        int startPageNo = Integer.parseInt(startParaInfo[1]);
        int endPageNo = Integer.parseInt(endParaInfo[1]);
        TextVO startPage = textVOS.get(startPageNo);
        //TextVO endPage = textVOS.get(endPageNo);
        TextVO.Line startLine = startPage.getParagraphs().get(0).getLines().get(startLineNo);
        //TextVO.Line endLine = endPage.getParagraphs().get(0).getLines().get(endLineNo);
        int startRemaining = startLine.getObjContent().length() - pos_info.get(0);
        int endRemaining = pos_info.get(1);
        int total = 0;

        //遍历所有能够到达的空余位并占有
        SimpleParaInfoVO startParaInfoVO = movePositionForward(startPageNo, startLineNo, textVOS, offsetLeft, startRemaining);

        target.setStartLineNo(startParaInfoVO.getLineNO());
        //targetParaInfos.set(0,startParaInfoVO.getLineId());
        targetPosInfo.set(0, startParaInfoVO.getPosNO());
        target.setPage(startParaInfoVO.getPageNO());

        int endTotal = 0;
        //System.out.println("total:"+total);
        SimpleParaInfoVO endParaInfoVO = movePositionBackward(endPageNo, endLineNo, textVOS, offsetRight, endRemaining);
        target.setEndLineNo(endParaInfoVO.getLineNO());
        if (endParaInfoVO.getPosNO() == 0) {
            endParaInfoVO = movePositionBackward(endParaInfoVO.getPageNO(), endParaInfoVO.getLineNO(),
                    textVOS, 1, 0);
            endParaInfoVO.setPosNO(endParaInfoVO.getPosNO() + 1);
        }
        targetParaInfos = getRangeParaInfos(startParaInfoVO.getLineId(), endParaInfoVO.getLineId(), textVOS);
        //targetParaInfos.set(1,endParaInfoVO.getLineId());
        targetPosInfo.set(1, endParaInfoVO.getPosNO());

        //System.out.println("endTotal:"+endTotal);
        target.setPos_info(targetPosInfo);
        target.setGlobal_pos(targetGlobalPos);
        target.setPara_info(targetParaInfos);
        return target;

    }

    /**
     * 工具方法：根据原始的坐标信息和偏移量获取后移后的坐标信息
     *
     * @param endPageNo    结束页码
     * @param endLineNo    结束行号
     * @param textVOS      全文文本对象
     * @param offset       偏移量（向后）
     * @param endRemaining 结束行的剩余字数
     * @return 偏移后的坐标信息
     */
    private static SimpleParaInfoVO movePositionForward(int endPageNo, int endLineNo, List<TextVO> textVOS, int offset, int endRemaining) {

        SimpleParaInfoVO result = new SimpleParaInfoVO();
        TextVO.Line endLine = textVOS.get(endPageNo).getParagraphs().get(0).getLines().get(endLineNo);
        int total = 0;
        TextVO endPage;
        if (offset == 0) {
            result.setPageNO(endPageNo);
            result.setLineNO(endLineNo);
            result.setLineId(endLine.getLineId());
            result.setPosNO(endLine.getObjContent().length() - endRemaining);
            return result;
        }
        for (int m = endPageNo; m < textVOS.size() && offset > 0; m++) {
            endPage = textVOS.get(m);
            int lineLimit = endPage.getParagraphs().get(0).getLines().size();
            int endIndex = m == endPageNo ? endLineNo : 0;
            result.setPageNO(m);
            for (int n = endIndex; n < lineLimit && offset > 0; n++) {
                int endLineCapacity = endLine.getObjContent().length();
                if (!(m == endPageNo && n == endIndex)) {
                    endLine = endPage.getParagraphs().get(0).getLines().get(n);
                    endLineCapacity = endLine.getObjContent().length();
                    endRemaining = endLineCapacity;
                }
                //logger.info("endLine:"+endLine.getLineId());
                //logger.info("ObjContent:"+endLine.getObjContent());
                //logger.info("endRemaining:"+endRemaining);
                //logger.info("offset:"+offset);
                result.setLineNO(n);
                result.setLineId(endLine.getLineId());
                if (endRemaining >= offset) {
                    result.setPosNO(endLineCapacity - (endRemaining - offset));
                }
                total += endRemaining;
                offset -= endRemaining;

            }
        }
        return result;

    }

    /**
     * 工具方法：根据原始的坐标信息和偏移量获取前移后的坐标信息
     *
     * @param startPageNo    开始页码
     * @param startLineNo    开始行号
     * @param textVOS        全文文本对象
     * @param offset         偏移量（向前）
     * @param startRemaining 起始行的剩余字数
     * @return 偏移后的坐标信息
     */
    private static SimpleParaInfoVO movePositionBackward(int startPageNo, int startLineNo, List<TextVO> textVOS, int offset, int startRemaining) {

        SimpleParaInfoVO result = new SimpleParaInfoVO();
        TextVO.Line startLine = textVOS.get(startPageNo).getParagraphs().get(0).getLines().get(startLineNo);
        TextVO startPage;
        if (offset == 0) {
            result.setPageNO(startPageNo);
            result.setLineNO(startLineNo);
            result.setLineId(startLine.getLineId());
            result.setPosNO(startRemaining);
            return result;
        }
        for (int i = startPageNo; i >= 0 && offset > 0; i--) {
            startPage = textVOS.get(i);
            int startLinesNum = startPage.getParagraphs().get(0).getLines().size();
            int lineLimit = i == startPageNo ? startLineNo : startLinesNum - 1;
            result.setPageNO(i);
            for (int j = lineLimit; j >= 0 && offset > 0; j--) {
                if (!(i == startPageNo && j == lineLimit)) {
                    startLine = startPage.getParagraphs().get(0).getLines().get(j);
                    startRemaining = startLine.getObjContent().length();
                }
                result.setLineNO(j);
                result.setLineId(startLine.getLineId());
                if (startRemaining >= offset) {
                    result.setPosNO(startRemaining - offset);
                }
                //logger.info(offset+"------"+startRemaining+"-------"+startLine.getObjContent());
                //total += startRemaining;
                offset -= startRemaining;
            }
        }
        return result;

    }

    private static List<String> getRangeParaInfos(String startParaInfo, String endParaInfo, List<TextVO> textVOS) {

        List<String> result = new ArrayList<>();
        String[] startParaInfos = startParaInfo.split("_");
        String[] endParaInfos = endParaInfo.split("_");
        int startPageNo = Integer.parseInt(startParaInfos[1]);
        int startLineNo = Integer.parseInt(startParaInfos[2]);
        int endPageNo = Integer.parseInt(endParaInfos[1]);
        int endLineNo = Integer.parseInt(endParaInfos[2]);
        for (int i = startPageNo; i <= endPageNo; i++) {

            int pageCapacity = textVOS.get(i).getParagraphs().get(0).getLines().size();
            int limit = i == endPageNo ? endLineNo : (pageCapacity - 1);
            startLineNo = i == startPageNo ? startLineNo : 0;
            for (int j = startLineNo; j <= limit; j++) {
                TextVO.Line line = textVOS.get(i).getParagraphs().get(0).getLines().get(j);
                result.add(line.getLineId());
            }

        }
        return result;

    }

    /**
     * 入口方法2：直接通过传入的起始和结束offset计算修正后的位置
     *
     * @param startOffset  起始坐标与修正后的起始坐标之间的差值 1->6为正(forward) 6->1为负(backward)
     * @param endOffset    结束坐标与修正后的结束坐标之间的差值 1->6为正(forward) 6->1为负(backward)
     * @param drawResultVO 原始模型要素对象
     * @param fileTextStr  json文本
     * @param rawText      cleanText文本
     * @return 修正后要素对象
     */
    public static TaskElementVO.DrawResultVO correctPositionInfoByOffset(TaskElementVO.DrawResultVO drawResultVO, int startOffset, int endOffset,
                                                                         String fileTextStr, String rawText) {

        int positiveStartOffset = Math.abs(startOffset);
        int positiveEndOffset = Math.abs(endOffset);
        if (startOffset >= 0 && endOffset > 0) {
            return movePositionForwardByOffset(drawResultVO, positiveStartOffset, positiveEndOffset, fileTextStr, rawText);
        } else if (startOffset >= 0) {
            return retractTextByOffset(drawResultVO, positiveStartOffset, positiveEndOffset, fileTextStr, rawText);
        } else if (endOffset < 0) {
            return movePositionBackwardByOffset(drawResultVO, positiveStartOffset, positiveEndOffset, fileTextStr, rawText);
        } else {
            return expandTextByCenterWithOffset(drawResultVO, positiveStartOffset, positiveEndOffset, fileTextStr, rawText);
        }

    }

    private static TaskElementVO.DrawResultVO movePositionBackwardByOffset(TaskElementVO.DrawResultVO drawResultVO, int startOffset, int endOffset, String fileTextStr, String rawText) {

        TaskElementVO.DrawResultVO target;
        target = drawResultVO;
        List<Integer> global_pos = drawResultVO.getGlobal_pos();
        List<String> paraInfos = drawResultVO.getPara_info();
        int startLineNo = drawResultVO.getStartLineNo();
        int endLineNo = drawResultVO.getEndLineNo();
        List<Integer> pos_info = drawResultVO.getPos_info();
        List<TextVO> textVOS = JSONArray.parseArray(fileTextStr, TextVO.class);

        List<Integer> targetPosInfo = drawResultVO.getPos_info();
        List<Integer> targetGlobalPos = new ArrayList<>();
        target.setGlobal_pos(targetGlobalPos);

        int startPos = global_pos.get(0);
        int endPos = global_pos.get(1);

        //定位全部文本位置，剪去不要的
        target.setStart(startPos - startOffset);
        target.setEnd(endPos - endOffset);
        target.setText(rawText.substring(startPos - startOffset, endPos - endOffset));
        targetGlobalPos.add(startPos - startOffset);
        targetGlobalPos.add(endPos - endOffset);

        //查看当前行有多少空余位
        String[] startParaInfo = paraInfos.get(0).split("_");
        String[] endParaInfo = paraInfos.get(paraInfos.size() - 1).split("_");
        int startPageNo = Integer.parseInt(startParaInfo[1]);
        int endPageNo = Integer.parseInt(endParaInfo[1]);
        int startRemaining = pos_info.get(0);
        int endRemaining = pos_info.get(1);

        SimpleParaInfoVO startParaInfoVO = movePositionBackward(startPageNo, startLineNo, textVOS, startOffset, startRemaining);
        target.setStartLineNo(startParaInfoVO.getLineNO());
        targetPosInfo.set(0, startParaInfoVO.getPosNO());
        target.setPage(startParaInfoVO.getPageNO());

        SimpleParaInfoVO endParaInfoVO = movePositionBackward(endPageNo, endLineNo, textVOS, endOffset, endRemaining);
        if (endParaInfoVO.getPosNO() == 0) {
            endParaInfoVO = movePositionBackward(endParaInfoVO.getPageNO(), endParaInfoVO.getLineNO(),
                    textVOS, 1, 0);
            endParaInfoVO.setPosNO(endParaInfoVO.getPosNO() + 1);
        }
        List<String> targetParaInfos = getRangeParaInfos(startParaInfoVO.getLineId(), endParaInfoVO.getLineId(), textVOS);
        target.setEndLineNo(endParaInfoVO.getLineNO());

        targetPosInfo.set(1, endParaInfoVO.getPosNO());

        target.setPos_info(targetPosInfo);
        target.setGlobal_pos(targetGlobalPos);
        target.setPara_info(targetParaInfos);
        return target;

    }

    private static TaskElementVO.DrawResultVO retractTextByOffset(TaskElementVO.DrawResultVO drawResultVO, int startOffset, int endOffset, String fileTextStr, String rawText) {

        TaskElementVO.DrawResultVO target;
        target = drawResultVO;
        List<Integer> global_pos = drawResultVO.getGlobal_pos();
        List<String> paraInfos = drawResultVO.getPara_info();
        int startLineNo = drawResultVO.getStartLineNo();
        int endLineNo = drawResultVO.getEndLineNo();
        List<Integer> pos_info = drawResultVO.getPos_info();
        List<TextVO> textVOS = JSONArray.parseArray(fileTextStr, TextVO.class);

        //获取全部文本
        String originalText = drawResultVO.getText();
        List<Integer> targetPosInfo = drawResultVO.getPos_info();
        List<Integer> targetGlobalPos = new ArrayList<>();
        target.setGlobal_pos(targetGlobalPos);

        int startPos = global_pos.get(0);
        int endPos = global_pos.get(1);
        int retractOffSet = 0;

        //定位全部文本位置，剪去不要的
        target.setStart(startPos + startOffset);
        target.setEnd(endPos - endOffset);
        target.setText(rawText.substring(startPos + startOffset, endPos - endOffset));
        targetGlobalPos.add(startPos + startOffset);
        targetGlobalPos.add(endPos - endOffset);

        //查看当前行有多少空余位
        String[] startParaInfo = paraInfos.get(0).split("_");
        String[] endParaInfo = paraInfos.get(paraInfos.size() - 1).split("_");
        int startPageNo = Integer.parseInt(startParaInfo[1]);
        int endPageNo = Integer.parseInt(endParaInfo[1]);
        TextVO startPage = textVOS.get(startPageNo);
        //TextVO endPage = textVOS.get(endPageNo);
        TextVO.Line startLine = startPage.getParagraphs().get(0).getLines().get(startLineNo);
        //TextVO.Line endLine = endPage.getParagraphs().get(0).getLines().get(endLineNo);
        int startRemaining = startLine.getObjContent().length() - pos_info.get(0);
        int endRemaining = pos_info.get(1);
        int total = 0;

        //遍历所有能够到达的空余位并占有
        SimpleParaInfoVO startParaInfoVO = movePositionForward(startPageNo, startLineNo, textVOS, startOffset, startRemaining);
        TextVO.Line line = textVOS.get(startParaInfoVO.getPageNO()).getParagraphs().get(0).getLines().get(startParaInfoVO.getLineNO());
        if (startParaInfoVO.getPosNO() == line.getObjContent().length()) {
            startParaInfoVO = movePositionForward(startParaInfoVO.getPageNO(), startParaInfoVO.getLineNO(),
                    textVOS, 1, 0);
            startParaInfoVO.setPosNO(startParaInfoVO.getPosNO() - 1);
        }

        target.setStartLineNo(startParaInfoVO.getLineNO());
        //targetParaInfos.set(0,startParaInfoVO.getLineId());
        targetPosInfo.set(0, startParaInfoVO.getPosNO());
        target.setPage(startParaInfoVO.getPageNO());

        int endTotal = 0;
        //System.out.println("total:"+total);
        SimpleParaInfoVO endParaInfoVO = movePositionBackward(endPageNo, endLineNo, textVOS, endOffset, endRemaining);
        target.setEndLineNo(endParaInfoVO.getLineNO());
        if (endParaInfoVO.getPosNO() == 0) {
            endParaInfoVO = movePositionBackward(endParaInfoVO.getPageNO(), endParaInfoVO.getLineNO(),
                    textVOS, 1, 0);
            endParaInfoVO.setPosNO(endParaInfoVO.getPosNO() + 1);
        }
        List<String> targetParaInfos = getRangeParaInfos(startParaInfoVO.getLineId(), endParaInfoVO.getLineId(), textVOS);
        //targetParaInfos.set(1,endParaInfoVO.getLineId());
        targetPosInfo.set(1, endParaInfoVO.getPosNO());

        //System.out.println("endTotal:"+endTotal);
        target.setPos_info(targetPosInfo);
        target.setGlobal_pos(targetGlobalPos);
        target.setPara_info(targetParaInfos);
        return target;

    }

    private static TaskElementVO.DrawResultVO movePositionForwardByOffset(TaskElementVO.DrawResultVO drawResultVO, int startOffset, int endOffset, String fileTextStr, String rawText) {

        TaskElementVO.DrawResultVO target;
        target = drawResultVO;
        List<Integer> global_pos = drawResultVO.getGlobal_pos();
        List<String> paraInfos = drawResultVO.getPara_info();
        int startLineNo = drawResultVO.getStartLineNo();
        int endLineNo = drawResultVO.getEndLineNo();
        List<Integer> pos_info = drawResultVO.getPos_info();
        List<TextVO> textVOS = JSONArray.parseArray(fileTextStr, TextVO.class);

        List<Integer> targetPosInfo = drawResultVO.getPos_info();
        List<Integer> targetGlobalPos = new ArrayList<>();
        List<String> targetParaInfos = new ArrayList<>();
        target.setGlobal_pos(targetGlobalPos);

        int startPos = global_pos.get(0);
        int endPos = global_pos.get(1);

        target.setStart(startPos + startOffset);
        target.setEnd(endPos + endOffset);
        target.setText(rawText.substring(startPos + startOffset, endPos + endOffset));
        targetGlobalPos.add(startPos + startOffset);
        targetGlobalPos.add(endPos + endOffset);

        //查看当前行有多少空余位
        String[] startParaInfo = paraInfos.get(0).split("_");
        String[] endParaInfo = paraInfos.get(paraInfos.size() - 1).split("_");
        int startPageNo = Integer.parseInt(startParaInfo[1]);
        int endPageNo = Integer.parseInt(endParaInfo[1]);
        TextVO startPage = textVOS.get(startPageNo);
        TextVO endPage = textVOS.get(endPageNo);
        TextVO.Line startLine = startPage.getParagraphs().get(0).getLines().get(startLineNo);
        TextVO.Line endLine = endPage.getParagraphs().get(0).getLines().get(endLineNo);
        int startRemaining = startLine.getObjContent().length() - pos_info.get(0);
        int endRemaining = endLine.getObjContent().length() - pos_info.get(1);

        SimpleParaInfoVO startParaInfoVO = movePositionForward(startPageNo, startLineNo, textVOS, startOffset, startRemaining);
        TextVO.Line line = textVOS.get(startParaInfoVO.getPageNO()).getParagraphs().get(0).getLines().get(startParaInfoVO.getLineNO());
        if (startParaInfoVO.getPosNO() == line.getObjContent().length()) {
            startParaInfoVO = movePositionForward(startParaInfoVO.getPageNO(), startParaInfoVO.getLineNO(),
                    textVOS, 1, 0);
            startParaInfoVO.setPosNO(startParaInfoVO.getPosNO() - 1);
        }

        target.setStartLineNo(startParaInfoVO.getLineNO());
        target.setPage(startParaInfoVO.getPageNO());
        targetPosInfo.set(0, startParaInfoVO.getPosNO());

        SimpleParaInfoVO endParaInfoVO = movePositionForward(endPageNo, endLineNo, textVOS, endOffset, endRemaining);
        target.setEndLineNo(endParaInfoVO.getLineNO());
        targetParaInfos = getRangeParaInfos(startParaInfoVO.getLineId(), endParaInfoVO.getLineId(), textVOS);
        targetPosInfo.set(1, endParaInfoVO.getPosNO());

        target.setPos_info(targetPosInfo);
        target.setGlobal_pos(targetGlobalPos);
        target.setPara_info(targetParaInfos);
        return target;

    }

    private static TaskElementVO.DrawResultVO expandTextByCenterWithOffset(TaskElementVO.DrawResultVO drawResultVO, int startOffset, int endOffset, String fileTextStr, String rawText) {

        TaskElementVO.DrawResultVO target;
        target = drawResultVO;
        List<Integer> global_pos = drawResultVO.getGlobal_pos();
        List<String> paraInfos = drawResultVO.getPara_info();
        int startLineNo = drawResultVO.getStartLineNo();
        int endLineNo = drawResultVO.getEndLineNo();
        List<Integer> pos_info = drawResultVO.getPos_info();

        List<TextVO> textVOS = JSONArray.parseArray(fileTextStr, TextVO.class);

        List<Integer> targetPosInfo = drawResultVO.getPos_info();
        List<Integer> targetGlobalPos = new ArrayList<>();
        target.setGlobal_pos(targetGlobalPos);

        int startPos = global_pos.get(0);
        int endPos = global_pos.get(1);

        target.setStart(startPos - startOffset);
        target.setEnd(endPos + endOffset);
        target.setText(rawText.substring(startPos - startOffset, endPos + endOffset));
        targetGlobalPos.add(startPos - startOffset);
        targetGlobalPos.add(endPos + endOffset);

        //查看当前行有多少空余位
        String[] startParaInfo = paraInfos.get(0).split("_");
        String[] endParaInfo = paraInfos.get(paraInfos.size() - 1).split("_");
        int startPageNo = Integer.parseInt(startParaInfo[1]);
        int endPageNo = Integer.parseInt(endParaInfo[1]);
        TextVO startPage = textVOS.get(startPageNo);
        TextVO endPage = textVOS.get(endPageNo);
        TextVO.Line startLine = startPage.getParagraphs().get(0).getLines().get(startLineNo);
        TextVO.Line endLine = endPage.getParagraphs().get(0).getLines().get(endLineNo);
        int startRemaining = pos_info.get(0);
        int endRemaining = endLine.getObjContent().length() - pos_info.get(1);

        SimpleParaInfoVO startParaInfoVO = movePositionBackward(startPageNo, startLineNo, textVOS, startOffset, startRemaining);
        target.setStartLineNo(startParaInfoVO.getLineNO());
        target.setPage(startParaInfoVO.getPageNO());
        targetPosInfo.set(0, startParaInfoVO.getPosNO());

        SimpleParaInfoVO endParaInfoVO = movePositionForward(endPageNo, endLineNo, textVOS, endOffset, endRemaining);
        target.setEndLineNo(endParaInfoVO.getLineNO());
        List<String> targetParaInfos = getRangeParaInfos(startParaInfoVO.getLineId(), endParaInfoVO.getLineId(), textVOS);
        targetPosInfo.set(1, endParaInfoVO.getPosNO());

        target.setPos_info(targetPosInfo);
        target.setGlobal_pos(targetGlobalPos);
        target.setPara_info(targetParaInfos);
        return target;

    }

    public static TaskElementVO.DrawResultVO correctPosInfoByIndex(TaskElementVO.DrawResultVO drawResultVO, int startIndex, int endIndex, String fileTextStr, String text) {

        TaskElementVO.DrawResultVO target;
        target = drawResultVO;
        target.setText(text);
        target.setCus_sample_id(UUID.randomUUID().toString());
        target.setDegree("0.0");
        target.setBusinessValue(text);
        List<Integer> globalPos = new ArrayList<>();
        globalPos.add(startIndex);
        globalPos.add(endIndex);
        target.setGlobal_pos(globalPos);
        int startLineNo = 0;
        int endLineNo = 0;
        String startLineId = "";
        String endLineId = "";
        int startPageNo = -1;
        int endPageNo = -1;
        List<Integer> posInfo = new ArrayList<>();
        List<TextVO> textVOS = JSONArray.parseArray(fileTextStr, TextVO.class);
        try {
            for (TextVO textVO : textVOS) {
                int pageStartIndex = textVO.getPageStartIndex();
                int pageEndIndex = textVO.getPageEndIndex();
                if (startIndex >= pageStartIndex && startIndex < pageEndIndex) {
                    startPageNo = textVO.getPageNo();
                    break;
                }
            }
            target.setPage(startPageNo);

            for (int i = startPageNo; i < textVOS.size() - 1; i++) {
                TextVO textVO = textVOS.get(i);
                int pageStartIndex = textVOS.get(i).getPageStartIndex();
                int pageEndIndex = textVO.getPageEndIndex();
                if (endIndex >= pageStartIndex && endIndex <= pageEndIndex) {
                    endPageNo = textVO.getPageNo();
                    break;
                }
            }
            if (endPageNo == -1) {
                endPageNo = textVOS.get(textVOS.size() - 1).getPageNo();
            }
            TextVO startTextVO = textVOS.get(startPageNo);
            List<TextVO.Line> startPageLines = startTextVO.getParagraphs().get(0).getLines();
            for (TextVO.Line startPageLine : startPageLines) {
                if (startIndex >= startPageLine.getLineStartIndex() && startIndex < startPageLine.getLineEndIndex()) {
                    startLineNo = startPageLine.getLineNo();
                    startLineId = startPageLine.getLineId();
                    posInfo.add(startIndex - startPageLine.getLineStartIndex());
                    break;
                }
            }
            target.setStartLineNo(startLineNo);

            TextVO endTextVO = textVOS.get(endPageNo);
            List<TextVO.Line> endPageLines = endTextVO.getParagraphs().get(0).getLines();
            for (TextVO.Line endPageLine : endPageLines) {
                if (endIndex >= endPageLine.getLineStartIndex() && endIndex <= endPageLine.getLineEndIndex()) {
                    endLineNo = endPageLine.getLineNo();
                    endLineId = endPageLine.getLineId();
                    posInfo.add(endIndex - endPageLine.getLineStartIndex());
                    break;
                }
            }
            target.setEndLineNo(endLineNo);
            List<String> targetParaInfos = getRangeParaInfos(startLineId, endLineId, textVOS);

            target.setPage(startPageNo);
            target.setPara_info(targetParaInfos);
            target.setGlobal_pos(globalPos);
            target.setStartLineNo(startLineNo);
            target.setEndLineNo(endLineNo);
            target.setPos_info(posInfo);
            target.setText(text);
            target.setCus_sample_id(UUID.randomUUID().toString());
            target.setDegree("0.0");
            target.setBusinessValue(text);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return target;

    }


    public static void main(String[] args) {
//        TaskElementVO.DrawResultVO object = new TaskElementVO.DrawResultVO();
//        String fileTextStr = FileUtils.readFile("D:\\tmp\\光证资管鑫优集合资产管理计划资产管理合同（光大银行反馈2020-8-6）-ebv2托管.json");
//        TaskElementVO.DrawResultVO ObjectNew = TextUtils.correctPosInfoByIndex(object,12601 ,12619 , fileTextStr, "资产");
//        System.out.println(ObjectNew);


        TaskElementVO.DrawResultVO object = new TaskElementVO.DrawResultVO();
        String fileTextStr = "[{\"pageEndIndex\":371,\"pageNo\":0,\"docID\":\"v1_2021-06-03-10-48-20_4qqZDwiXb180\",\"pageStartIndex\":0,\"paragraphs\":[{\"paraId\":\"0\",\"paraNo\":0,\"lines\":[{\"lineNo\":0,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_0_cusline0\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":1,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_1_cusline1\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":2,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_2_cusline2\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":3,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_3_cusline3\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":4,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_4_cusline4\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":5,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_5_cusline5\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":6,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_6_cusline6\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":7,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_7_cusline7\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":8,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_8_cusline8\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":9,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_9_cusline9\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":10,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_10_cusline10\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":11,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_11_cusline11\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":12,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_12_cusline12\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":13,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_13_cusline13\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":14,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_14_cusline14\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":15,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_15_cusline15\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":16,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_16_cusline16\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":17,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_17_cusline17\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":18,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_18_cusline18\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":19,\"lineEndIndex\":0,\"objContent\":\"\",\"lineStartIndex\":0,\"lineId\":\"line_0_19_cusline19\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":20,\"objContent\":[{\"rowNo\":0,\"lineNo\":0,\"lineEndIndex\":25,\"objContent\":\"关于南昌农商银行百福理财聚福宝系列理财产品A款的:\",\"lineStartIndex\":0,\"lineId\":\"line_0_0_QeqZDwiXe8b1\",\"objType\":\"textLine\",\"objPos\":[443,341,40,1067]},{\"rowNo\":1,\"lineNo\":0,\"lineEndIndex\":32,\"objContent\":\"申购赎回说明:\",\"lineStartIndex\":25,\"lineId\":\"line_0_1_QWqZDwiX80e7\",\"objType\":\"textLine\",\"objPos\":[530,750,38,251]},{\"rowNo\":2,\"lineNo\":0,\"lineEndIndex\":43,\"objContent\":\"兴业银行资产托管部：:\",\"lineStartIndex\":32,\"lineId\":\"line_0_2_QwqZDwiX73e1\",\"objType\":\"textLine\",\"objPos\":[708,301,33,401]},{\"rowNo\":3,\"lineNo\":0,\"lineEndIndex\":69,\"objContent\":\"鉴于我行发行且在贵部托管的南昌农商银行百福理财聚福:\",\"lineStartIndex\":43,\"lineId\":\"line_0_3_QEqZDwiXb143\",\"objType\":\"textLine\",\"objPos\":[794,383,36,1072]},{\"rowNo\":4,\"lineNo\":0,\"lineEndIndex\":102,\"objContent\":\"宝系列理财产品A款已于2021年05月31日-06月02日进入开:\",\"lineStartIndex\":69,\"lineId\":\"line_0_4_QgqZDwiX1e30\",\"objType\":\"textLine\",\"objPos\":[881,299,36,1155]},{\"rowNo\":5,\"lineNo\":0,\"lineEndIndex\":133,\"objContent\":\"放期，该次开放期的申购、赎回确认工作将在2021年06月03:\",\"lineStartIndex\":102,\"lineId\":\"line_0_5_Q4qZDwiXb0d0\",\"objType\":\"textLine\",\"objPos\":[966,298,36,1160]},{\"rowNo\":6,\"lineNo\":0,\"lineEndIndex\":161,\"objContent\":\"日进行确认。现将本次开放期内的申购、赎回情况说明如下：:\",\"lineStartIndex\":133,\"lineId\":\"line_0_6_QOqZDwiX240b\",\"objType\":\"textLine\",\"objPos\":[1054,305,37,1098]},{\"rowNo\":7,\"lineNo\":0,\"lineEndIndex\":193,\"objContent\":\"1、本次开放期共接受产品申购申请25，493,000.00元；:\",\"lineStartIndex\":161,\"lineId\":\"line_0_7_QiqZDwiX13b4\",\"objType\":\"textLine\",\"objPos\":[1142,379,39,1018]},{\"rowNo\":8,\"lineNo\":0,\"lineEndIndex\":226,\"objContent\":\"2、本次开放期共接受产品续回申请30，411，198.36份，对:\",\"lineStartIndex\":193,\"lineId\":\"line_0_8_QsqZDwiX2710\",\"objType\":\"textLine\",\"objPos\":[1229,382,37,1073]},{\"rowNo\":9,\"lineNo\":0,\"lineEndIndex\":248,\"objContent\":\"应续回金额应为30，411，198.36元:\",\"lineStartIndex\":226,\"lineId\":\"line_0_9_QCqZDwiX7bfb\",\"objType\":\"textLine\",\"objPos\":[1317,304,33,649]},{\"rowNo\":10,\"lineNo\":0,\"lineEndIndex\":273,\"objContent\":\"为确保产品正常兑付，请贵部从本理财托管户划付资金:\",\"lineStartIndex\":248,\"lineId\":\"line_0_10_QMqZDwiX419f\",\"objType\":\"textLine\",\"objPos\":[1402,386,36,1000]},{\"rowNo\":11,\"lineNo\":0,\"lineEndIndex\":294,\"objContent\":\"30，411，198.36元至如下账户：:\",\"lineStartIndex\":273,\"lineId\":\"line_0_11_QgqZDwiXb304\",\"objType\":\"textLine\",\"objPos\":[1494,299,33,566]},{\"rowNo\":12,\"lineNo\":0,\"lineEndIndex\":312,\"objContent\":\"户名：南昌农村商业银行股份有限公司:\",\"lineStartIndex\":294,\"lineId\":\"line_0_12_QqqZDwiX2103\",\"objType\":\"textLine\",\"objPos\":[1575,385,36,707]},{\"rowNo\":13,\"lineNo\":0,\"lineEndIndex\":328,\"objContent\":\"账号：197700556155:\",\"lineStartIndex\":312,\"lineId\":\"line_0_13_Q0qZDwiXbed3\",\"objType\":\"textLine\",\"objPos\":[1663,387,35,372]},{\"rowNo\":14,\"lineNo\":0,\"lineEndIndex\":339,\"objContent\":\"开户行：中行东湖支行:\",\"lineStartIndex\":328,\"lineId\":\"line_0_14_Q0qZDwiX07e3\",\"objType\":\"textLine\",\"objPos\":[1751,388,34,408]},{\"rowNo\":15,\"lineNo\":0,\"lineEndIndex\":357,\"objContent\":\"大额行号：104421072641:\",\"lineStartIndex\":339,\"lineId\":\"line_0_15_QUqZDwiXd9b3\",\"objType\":\"textLine\",\"objPos\":[1837,389,36,495]}],\"lineId\":\"line_0_20_QSqZDwiX0214\",\"objType\":\"table\",\"objPos\":[211,223,1670,1336]},{\"lineNo\":16,\"lineEndIndex\":359,\"objContent\":\"XI\",\"lineStartIndex\":357,\"lineId\":\"line_0_16_QUqZDwiXdb27\",\"objType\":\"textLine\",\"objPos\":[1960,1132,119,83]},{\"lineNo\":17,\"lineEndIndex\":363,\"objContent\":\"行股分有\",\"lineStartIndex\":359,\"lineId\":\"line_0_17_QeqZDwiXb0b7\",\"objType\":\"textLine\",\"objPos\":[1975,1231,65,108]},{\"lineNo\":18,\"lineEndIndex\":368,\"objContent\":\"银保股份有\",\"lineStartIndex\":363,\"lineId\":\"line_0_18_QeqZDwiXe01d\",\"objType\":\"textLine\",\"objPos\":[2096,1129,48,229]},{\"lineNo\":19,\"lineEndIndex\":371,\"objContent\":\"限公司\",\"lineStartIndex\":368,\"lineId\":\"line_0_19_QoqZDwiXf2e0\",\"objType\":\"textLine\",\"objPos\":[2098,1341,38,122]}]}]},{\"pageEndIndex\":670,\"pageNo\":1,\"docID\":\"v1_2021-06-03-10-48-20_4qqZDwiXb180\",\"pageStartIndex\":371,\"paragraphs\":[{\"paraId\":\"0\",\"paraNo\":0,\"lines\":[{\"lineNo\":0,\"lineEndIndex\":25,\"objContent\":\"附件四：\",\"lineStartIndex\":0,\"lineId\":\"line_0_0_IgqZDwiXf2f4\",\"objType\":\"textLine\",\"objPos\":[233,293,35,114]},{\"lineNo\":1,\"lineEndIndex\":32,\"objContent\":\"理财产品理财资金运用划款指令\",\"lineStartIndex\":25,\"lineId\":\"line_0_1_IkqZDwiX24eb\",\"objType\":\"textLine\",\"objPos\":[312,643,29,463]},{\"lineNo\":2,\"lineEndIndex\":43,\"objContent\":\"2021年06月03日\",\"lineStartIndex\":32,\"lineId\":\"line_0_2_IqqZDwiXb10b\",\"objType\":\"textLine\",\"objPos\":[435,294,27,265]},{\"lineNo\":3,\"lineEndIndex\":69,\"objContent\":\"编号：\",\"lineStartIndex\":43,\"lineId\":\"line_0_3_ISqZDwiXdb17\",\"objType\":\"textLine\",\"objPos\":[445,1324,40,86]},{\"lineNo\":4,\"lineEndIndex\":102,\"objContent\":\"\",\"lineStartIndex\":69,\"lineId\":\"line_1_4_cusline4\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":5,\"lineEndIndex\":133,\"objContent\":\"\",\"lineStartIndex\":102,\"lineId\":\"line_1_5_cusline5\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":6,\"lineEndIndex\":161,\"objContent\":\"\",\"lineStartIndex\":133,\"lineId\":\"line_1_6_cusline6\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":7,\"lineEndIndex\":193,\"objContent\":\"\",\"lineStartIndex\":161,\"lineId\":\"line_1_7_cusline7\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":8,\"lineEndIndex\":226,\"objContent\":\"\",\"lineStartIndex\":193,\"lineId\":\"line_1_8_cusline8\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":9,\"lineEndIndex\":248,\"objContent\":\"\",\"lineStartIndex\":226,\"lineId\":\"line_1_9_cusline9\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":10,\"lineEndIndex\":273,\"objContent\":\"\",\"lineStartIndex\":248,\"lineId\":\"line_1_10_cusline10\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":11,\"lineEndIndex\":294,\"objContent\":\"\",\"lineStartIndex\":273,\"lineId\":\"line_1_11_cusline11\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":12,\"lineEndIndex\":312,\"objContent\":\"\",\"lineStartIndex\":294,\"lineId\":\"line_1_12_cusline12\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":13,\"lineEndIndex\":328,\"objContent\":\"\",\"lineStartIndex\":312,\"lineId\":\"line_1_13_cusline13\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":14,\"lineEndIndex\":339,\"objContent\":\"\",\"lineStartIndex\":328,\"lineId\":\"line_1_14_cusline14\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":15,\"lineEndIndex\":357,\"objContent\":\"\",\"lineStartIndex\":339,\"lineId\":\"line_1_15_cusline15\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":16,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_16_cusline16\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":17,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_17_cusline17\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":18,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_18_cusline18\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":19,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_19_cusline19\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":20,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_20_cusline20\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":21,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_21_cusline21\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":22,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_22_cusline22\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":23,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_23_cusline23\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":24,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_24_cusline24\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":25,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_25_cusline25\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":26,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_26_cusline26\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":27,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_27_cusline27\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":28,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_28_cusline28\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":29,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_29_cusline29\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":30,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_30_cusline30\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":31,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_31_cusline31\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":32,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_32_cusline32\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":33,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_33_cusline33\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":34,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_34_cusline34\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":35,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_35_cusline35\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":36,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_36_cusline36\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":37,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_37_cusline37\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":38,\"lineEndIndex\":371,\"objContent\":\"\",\"lineStartIndex\":371,\"lineId\":\"line_1_38_cusline38\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":39,\"objContent\":[{\"rowNo\":0,\"lineNo\":0,\"lineEndIndex\":388,\"objContent\":\"付款户名：南昌农商银行百福理财聚:\",\"lineStartIndex\":371,\"lineId\":\"line_0_4_IaqZDwiX04b0\",\"objType\":\"textLine\",\"objPos\":[519,322,29,547]},{\"rowNo\":1,\"lineNo\":0,\"lineEndIndex\":401,\"objContent\":\"福宝系列001号理财产品:\",\"lineStartIndex\":388,\"lineId\":\"line_0_6_I0qZDwiX6e63\",\"objType\":\"textLine\",\"objPos\":[573,291,29,361]},{\"rowNo\":1,\"lineNo\":1,\"lineEndIndex\":414,\"objContent\":\"福宝系列001号理财产品:\",\"lineStartIndex\":401,\"lineId\":\"line_0_7_IMqZDwiX088b\",\"objType\":\"textLine\",\"objPos\":[580,876,30,359]},{\"rowNo\":2,\"lineNo\":0,\"lineEndIndex\":428,\"objContent\":\"付款账号：31021419:\",\"lineStartIndex\":414,\"lineId\":\"line_0_8_JeqZDwiX4e20\",\"objType\":\"textLine\",\"objPos\":[659,319,27,297]},{\"rowNo\":2,\"lineNo\":1,\"lineEndIndex\":452,\"objContent\":\"收款账号：502010100100573383:\",\"lineStartIndex\":428,\"lineId\":\"line_0_9_JmqZDwiXf61e\",\"objType\":\"textLine\",\"objPos\":[667,904,27,464]},{\"rowNo\":3,\"lineNo\":0,\"lineEndIndex\":469,\"objContent\":\"开户行：广发证券股份有限公司慈溪:\",\"lineStartIndex\":452,\"lineId\":\"line_0_10_JGqZDwiX46a2\",\"objType\":\"textLine\",\"objPos\":[744,318,29,546]},{\"rowNo\":3,\"lineNo\":1,\"lineEndIndex\":485,\"objContent\":\"开户行：兴业银行南昌分行营业部:\",\"lineStartIndex\":469,\"lineId\":\"line_0_11_JaqZDwiXf104\",\"objType\":\"textLine\",\"objPos\":[751,902,29,499]},{\"rowNo\":4,\"lineNo\":0,\"lineEndIndex\":494,\"objContent\":\"许山路证券营业部:\",\"lineStartIndex\":485,\"lineId\":\"line_0_12_JuqZDwiX419f\",\"objType\":\"textLine\",\"objPos\":[800,290,28,260]},{\"rowNo\":5,\"lineNo\":0,\"lineEndIndex\":511,\"objContent\":\"大写金额：壹仟零壹拾万零捌佰肆拾:\",\"lineStartIndex\":494,\"lineId\":\"line_0_13_JOqZDwiX8fb0\",\"objType\":\"textLine\",\"objPos\":[883,316,29,546]},{\"rowNo\":5,\"lineNo\":1,\"lineEndIndex\":530,\"objContent\":\"小写金额：10，100，840.50:\",\"lineStartIndex\":511,\"lineId\":\"line_0_14_JYqZDwiXe0b1\",\"objType\":\"textLine\",\"objPos\":[891,902,30,414]},{\"rowNo\":6,\"lineNo\":0,\"lineEndIndex\":535,\"objContent\":\"元伍角整:\",\"lineStartIndex\":530,\"lineId\":\"line_0_15_JsqZDwiX8097\",\"objType\":\"textLine\",\"objPos\":[934,285,37,132]},{\"rowNo\":7,\"lineNo\":0,\"lineEndIndex\":545,\"objContent\":\"用途及备注：证转银:\",\"lineStartIndex\":535,\"lineId\":\"line_0_16_JCqZDwiX2ce1\",\"objType\":\"textLine\",\"objPos\":[1025,315,29,296]},{\"rowNo\":8,\"lineNo\":0,\"lineEndIndex\":549,\"objContent\":\"管理人:\",\"lineStartIndex\":545,\"lineId\":\"line_0_17_JWqZDwiXb143\",\"objType\":\"textLine\",\"objPos\":[1243,307,38,102]},{\"rowNo\":8,\"lineNo\":1,\"lineEndIndex\":561,\"objContent\":\"管理人预留印鉴盖章处：:\",\"lineStartIndex\":549,\"lineId\":\"line_0_18_JgqZDwiX1930\",\"objType\":\"textLine\",\"objPos\":[1255,897,29,343]},{\"rowNo\":9,\"lineNo\":0,\"lineEndIndex\":566,\"objContent\":\"经办人：:\",\"lineStartIndex\":561,\"lineId\":\"line_0_20_JKqZDwiX240b\",\"objType\":\"textLine\",\"objPos\":[1311,308,35,114]},{\"rowNo\":9,\"lineNo\":1,\"lineEndIndex\":569,\"objContent\":\"徐问:\",\"lineStartIndex\":566,\"lineId\":\"line_0_19_J0qZDwiXbad0\",\"objType\":\"textLine\",\"objPos\":[1304,453,36,99]},{\"rowNo\":9,\"lineNo\":2,\"lineEndIndex\":574,\"objContent\":\"限份有限:\",\"lineStartIndex\":569,\"lineId\":\"line_0_21_JeqZDwiX13b4\",\"objType\":\"textLine\",\"objPos\":[1309,1145,59,110]},{\"rowNo\":10,\"lineNo\":0,\"lineEndIndex\":579,\"objContent\":\"复核人：:\",\"lineStartIndex\":574,\"lineId\":\"line_0_22_JoqZDwiX2730\",\"objType\":\"textLine\",\"objPos\":[1385,308,34,110]},{\"rowNo\":10,\"lineNo\":1,\"lineEndIndex\":583,\"objContent\":\"刘洁杰:\",\"lineStartIndex\":579,\"lineId\":\"line_0_23_J8qZDwiX2bfb\",\"objType\":\"textLine\",\"objPos\":[1393,478,35,104]},{\"rowNo\":11,\"lineNo\":0,\"lineEndIndex\":589,\"objContent\":\"审核签发人:\",\"lineStartIndex\":583,\"lineId\":\"line_0_25_JcqZDwiXb307\",\"objType\":\"textLine\",\"objPos\":[1455,311,31,168]},{\"rowNo\":11,\"lineNo\":1,\"lineEndIndex\":592,\"objContent\":\"万俊:\",\"lineStartIndex\":589,\"lineId\":\"line_0_28_J6qZDwiX02e3\",\"objType\":\"textLine\",\"objPos\":[1484,525,38,95]},{\"rowNo\":11,\"lineNo\":2,\"lineEndIndex\":594,\"objContent\":\"面:\",\"lineStartIndex\":592,\"lineId\":\"line_0_24_J8qZDwiX419f\",\"objType\":\"textLine\",\"objPos\":[1441,979,17,51]},{\"rowNo\":11,\"lineNo\":3,\"lineEndIndex\":598,\"objContent\":\"180:\",\"lineStartIndex\":594,\"lineId\":\"line_0_27_JwqZDwiXbed3\",\"objType\":\"textLine\",\"objPos\":[1472,981,22,51]},{\"rowNo\":11,\"lineNo\":4,\"lineEndIndex\":604,\"objContent\":\"金融市场部:\",\"lineStartIndex\":598,\"lineId\":\"line_0_29_JQqZDwiXd1b3\",\"objType\":\"textLine\",\"objPos\":[1500,1022,68,174]},{\"rowNo\":11,\"lineNo\":5,\"lineEndIndex\":606,\"objContent\":\"豆:\",\"lineStartIndex\":604,\"lineId\":\"line_0_26_JwqZDwiX2103\",\"objType\":\"textLine\",\"objPos\":[1453,1188,22,42]},{\"rowNo\":12,\"lineNo\":0,\"lineEndIndex\":613,\"objContent\":\"密押（可选）:\",\"lineStartIndex\":606,\"lineId\":\"line_0_30_JkqZDwiXdb22\",\"objType\":\"textLine\",\"objPos\":[1593,308,33,193]},{\"rowNo\":13,\"lineNo\":0,\"lineEndIndex\":618,\"objContent\":\"托管银行:\",\"lineStartIndex\":613,\"lineId\":\"line_0_31_J4qZDwiXb0b7\",\"objType\":\"textLine\",\"objPos\":[1676,304,34,132]},{\"rowNo\":13,\"lineNo\":1,\"lineEndIndex\":635,\"objContent\":\"托管银行确认理财资金运用划款指令:\",\"lineStartIndex\":618,\"lineId\":\"line_0_32_JEqZDwiX9010\",\"objType\":\"textLine\",\"objPos\":[1686,890,30,546]},{\"rowNo\":14,\"lineNo\":0,\"lineEndIndex\":640,\"objContent\":\"经办人：:\",\"lineStartIndex\":635,\"lineId\":\"line_0_33_JOqZDwiXf2e0\",\"objType\":\"textLine\",\"objPos\":[1746,302,38,113]},{\"rowNo\":14,\"lineNo\":1,\"lineEndIndex\":646,\"objContent\":\"已经执行。:\",\"lineStartIndex\":640,\"lineId\":\"line_0_34_JYqZDwiX021a\",\"objType\":\"textLine\",\"objPos\":[1738,863,33,144]},{\"rowNo\":15,\"lineNo\":0,\"lineEndIndex\":651,\"objContent\":\"复核人：:\",\"lineStartIndex\":646,\"lineId\":\"line_0_35_JsqZDwiX1abb\",\"objType\":\"textLine\",\"objPos\":[1816,302,37,113]},{\"rowNo\":15,\"lineNo\":1,\"lineEndIndex\":664,\"objContent\":\"签章（资金清算专用章）：:\",\"lineStartIndex\":651,\"lineId\":\"line_0_36_JoqZDwiX094e\",\"objType\":\"textLine\",\"objPos\":[1810,890,30,362]},{\"rowNo\":16,\"lineNo\":0,\"lineEndIndex\":669,\"objContent\":\"审批人：:\",\"lineStartIndex\":664,\"lineId\":\"line_0_37_JEqZDwiX7fbd\",\"objType\":\"textLine\",\"objPos\":[1883,302,38,111]}],\"lineId\":\"line_0_39_JMqZDwiX64bf\",\"objType\":\"table\",\"objPos\":[492,279,1582,1164]},{\"lineNo\":5,\"lineEndIndex\":133,\"objContent\":\"收款户名：南昌农商银行百福理财聚\",\"lineStartIndex\":102,\"lineId\":\"line_0_5_IiqZDwiX1bfb\",\"objType\":\"textLine\",\"objPos\":[527,905,30,545]},{\"lineNo\":38,\"lineEndIndex\":670,\"objContent\":\"1\",\"lineStartIndex\":669,\"lineId\":\"line_0_38_JiqZDwiX8bf1\",\"objType\":\"textLine\",\"objPos\":[2379,847,6,5]}]}]},{\"pageEndIndex\":753,\"pageNo\":2,\"docID\":\"v1_2021-06-03-10-48-20_4qqZDwiXb180\",\"pageStartIndex\":670,\"paragraphs\":[{\"paraId\":\"0\",\"paraNo\":0,\"lines\":[{\"lineNo\":0,\"lineEndIndex\":25,\"objContent\":\"附件四：\",\"lineStartIndex\":0,\"lineId\":\"line_0_0_JIqZDwiXecb1\",\"objType\":\"textLine\",\"objPos\":[265,286,35,117]},{\"lineNo\":1,\"lineEndIndex\":32,\"objContent\":\"理财产品理财资金运用划款指令\",\"lineStartIndex\":25,\"lineId\":\"line_0_1_JCqZDwiX8097\",\"objType\":\"textLine\",\"objPos\":[355,636,30,463]},{\"lineNo\":2,\"lineEndIndex\":43,\"objContent\":\"2021年06月03日\",\"lineStartIndex\":32,\"lineId\":\"line_0_2_J8qZDwiX10e1\",\"objType\":\"textLine\",\"objPos\":[467,343,29,275]},{\"lineNo\":3,\"lineEndIndex\":69,\"objContent\":\"编号：\",\"lineStartIndex\":43,\"lineId\":\"line_0_3_JGqZDwiXb143\",\"objType\":\"textLine\",\"objPos\":[512,1331,35,95]},{\"lineNo\":4,\"lineEndIndex\":388,\"objContent\":\"！\",\"lineStartIndex\":371,\"lineId\":\"line_0_4_JOqZDwiX1930\",\"objType\":\"textLine\",\"objPos\":[526,329,20,63]},{\"lineNo\":5,\"lineEndIndex\":133,\"objContent\":\"付款户名：南昌农商银行百福理财聚\",\"lineStartIndex\":102,\"lineId\":\"line_0_5_JgqZDwiXbed0\",\"objType\":\"textLine\",\"objPos\":[550,308,30,547]},{\"lineNo\":6,\"lineEndIndex\":401,\"objContent\":\"收款户名：南昌农村商业银行股份有\",\"lineStartIndex\":388,\"lineId\":\"line_0_6_JeqZDwiX340b\",\"objType\":\"textLine\",\"objPos\":[562,897,37,542]},{\"lineNo\":7,\"lineEndIndex\":414,\"objContent\":\"福宝系列001号理财产品\",\"lineStartIndex\":401,\"lineId\":\"line_0_7_JcqZDwiX13b4\",\"objType\":\"textLine\",\"objPos\":[602,277,30,362]},{\"lineNo\":8,\"lineEndIndex\":428,\"objContent\":\"\",\"lineStartIndex\":414,\"lineId\":\"line_2_8_cusline8\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":9,\"lineEndIndex\":452,\"objContent\":\"\",\"lineStartIndex\":428,\"lineId\":\"line_2_9_cusline9\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":10,\"lineEndIndex\":469,\"objContent\":\"\",\"lineStartIndex\":452,\"lineId\":\"line_2_10_cusline10\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":11,\"lineEndIndex\":485,\"objContent\":\"\",\"lineStartIndex\":469,\"lineId\":\"line_2_11_cusline11\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":12,\"lineEndIndex\":494,\"objContent\":\"\",\"lineStartIndex\":485,\"lineId\":\"line_2_12_cusline12\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":13,\"lineEndIndex\":511,\"objContent\":\"\",\"lineStartIndex\":494,\"lineId\":\"line_2_13_cusline13\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":14,\"lineEndIndex\":530,\"objContent\":\"\",\"lineStartIndex\":511,\"lineId\":\"line_2_14_cusline14\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":15,\"lineEndIndex\":535,\"objContent\":\"\",\"lineStartIndex\":530,\"lineId\":\"line_2_15_cusline15\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":16,\"lineEndIndex\":545,\"objContent\":\"\",\"lineStartIndex\":535,\"lineId\":\"line_2_16_cusline16\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":17,\"lineEndIndex\":549,\"objContent\":\"\",\"lineStartIndex\":545,\"lineId\":\"line_2_17_cusline17\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":18,\"lineEndIndex\":561,\"objContent\":\"\",\"lineStartIndex\":549,\"lineId\":\"line_2_18_cusline18\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":19,\"lineEndIndex\":569,\"objContent\":\"\",\"lineStartIndex\":566,\"lineId\":\"line_2_19_cusline19\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":20,\"lineEndIndex\":566,\"objContent\":\"\",\"lineStartIndex\":561,\"lineId\":\"line_2_20_cusline20\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":21,\"lineEndIndex\":574,\"objContent\":\"\",\"lineStartIndex\":569,\"lineId\":\"line_2_21_cusline21\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":22,\"lineEndIndex\":579,\"objContent\":\"\",\"lineStartIndex\":574,\"lineId\":\"line_2_22_cusline22\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":23,\"lineEndIndex\":583,\"objContent\":\"\",\"lineStartIndex\":579,\"lineId\":\"line_2_23_cusline23\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":24,\"lineEndIndex\":594,\"objContent\":\"\",\"lineStartIndex\":592,\"lineId\":\"line_2_24_cusline24\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":25,\"lineEndIndex\":589,\"objContent\":\"\",\"lineStartIndex\":583,\"lineId\":\"line_2_25_cusline25\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":26,\"lineEndIndex\":606,\"objContent\":\"\",\"lineStartIndex\":604,\"lineId\":\"line_2_26_cusline26\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":27,\"lineEndIndex\":598,\"objContent\":\"\",\"lineStartIndex\":594,\"lineId\":\"line_2_27_cusline27\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":28,\"lineEndIndex\":592,\"objContent\":\"\",\"lineStartIndex\":589,\"lineId\":\"line_2_28_cusline28\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":29,\"lineEndIndex\":604,\"objContent\":\"\",\"lineStartIndex\":598,\"lineId\":\"line_2_29_cusline29\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":30,\"lineEndIndex\":613,\"objContent\":\"\",\"lineStartIndex\":606,\"lineId\":\"line_2_30_cusline30\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":31,\"lineEndIndex\":618,\"objContent\":\"\",\"lineStartIndex\":613,\"lineId\":\"line_2_31_cusline31\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":32,\"lineEndIndex\":635,\"objContent\":\"\",\"lineStartIndex\":618,\"lineId\":\"line_2_32_cusline32\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":33,\"lineEndIndex\":640,\"objContent\":\"\",\"lineStartIndex\":635,\"lineId\":\"line_2_33_cusline33\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":34,\"lineEndIndex\":646,\"objContent\":\"\",\"lineStartIndex\":640,\"lineId\":\"line_2_34_cusline34\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":35,\"lineEndIndex\":651,\"objContent\":\"\",\"lineStartIndex\":646,\"lineId\":\"line_2_35_cusline35\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":36,\"lineEndIndex\":664,\"objContent\":\"\",\"lineStartIndex\":651,\"lineId\":\"line_2_36_cusline36\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":37,\"lineEndIndex\":669,\"objContent\":\"\",\"lineStartIndex\":664,\"lineId\":\"line_2_37_cusline37\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":38,\"lineEndIndex\":670,\"objContent\":\"\",\"lineStartIndex\":670,\"lineId\":\"line_2_38_cusline38\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":39,\"lineEndIndex\":670,\"objContent\":\"\",\"lineStartIndex\":670,\"lineId\":\"line_2_39_cusline39\",\"objPos\":[0,0,0,0],\"objType\":\"textLine\"},{\"lineNo\":40,\"objContent\":[{\"rowNo\":0,\"lineNo\":0,\"lineEndIndex\":674,\"objContent\":\"限公司:\",\"lineStartIndex\":670,\"lineId\":\"line_0_8_JQqZDwiX37e0\",\"objType\":\"textLine\",\"objPos\":[624,858,34,100]},{\"rowNo\":1,\"lineNo\":0,\"lineEndIndex\":698,\"objContent\":\"付款账号：502010100100573383:\",\"lineStartIndex\":674,\"lineId\":\"line_0_9_JEqZDwiX1bfb\",\"objType\":\"textLine\",\"objPos\":[691,303,27,465]},{\"rowNo\":1,\"lineNo\":1,\"lineEndIndex\":716,\"objContent\":\"收款账号：197700556155:\",\"lineStartIndex\":698,\"lineId\":\"line_0_10_JcqZDwiX419f\",\"objType\":\"textLine\",\"objPos\":[707,890,30,365]},{\"rowNo\":2,\"lineNo\":0,\"lineEndIndex\":732,\"objContent\":\"开户行：兴业银行南昌分行营业部:\",\"lineStartIndex\":716,\"lineId\":\"line_0_11_JOqZDwiXb305\",\"objType\":\"textLine\",\"objPos\":[772,296,34,518]},{\"rowNo\":3,\"lineNo\":0,\"lineEndIndex\":748,\"objContent\":\"开户行：中国银行南昌市东湖支行:\",\"lineStartIndex\":732,\"lineId\":\"line_0_12_JqqZDwiX3103\",\"objType\":\"textLine\",\"objPos\":[796,919,30,496]}],\"lineId\":\"line_0_40_JQqZDwiXc1e9\",\"objType\":\"table\",\"objPos\":[571,279,293,1153]},{\"lineNo\":13,\"lineEndIndex\":511,\"objContent\":\"大写金额：叁仟零肆拾壹万壹仟壹佰\",\"lineStartIndex\":494,\"lineId\":\"line_0_13_JeqZDwiXbed3\",\"objType\":\"textLine\",\"objPos\":[859,294,30,546]},{\"lineNo\":14,\"lineEndIndex\":530,\"objContent\":\"小写金额：30，411，198.36\",\"lineStartIndex\":511,\"lineId\":\"line_0_14_J8qZDwiX01e3\",\"objType\":\"textLine\",\"objPos\":[886,879,30,414]},{\"lineNo\":15,\"lineEndIndex\":535,\"objContent\":\"玖拾捌元叁角陆分\",\"lineStartIndex\":530,\"lineId\":\"line_0_15_JGqZDwiXddb3\",\"objType\":\"textLine\",\"objPos\":[913,262,30,261]},{\"lineNo\":16,\"lineEndIndex\":545,\"objContent\":\"用途及备注：理财赎回\",\"lineStartIndex\":535,\"lineId\":\"line_0_16_JgqZDwiXdb31\",\"objType\":\"textLine\",\"objPos\":[999,288,29,328]},{\"lineNo\":17,\"lineEndIndex\":549,\"objContent\":\"管理人\",\"lineStartIndex\":545,\"lineId\":\"line_0_17_JqqZDwiXb0b7\",\"objType\":\"textLine\",\"objPos\":[1150,277,38,101]},{\"lineNo\":18,\"lineEndIndex\":561,\"objContent\":\"管理人预留印鉴盖章处：\",\"lineStartIndex\":549,\"lineId\":\"line_0_18_JqqZDwiX901f\",\"objType\":\"textLine\",\"objPos\":[1181,866,30,342]},{\"lineNo\":19,\"lineEndIndex\":569,\"objContent\":\"经办人：徐司\",\"lineStartIndex\":566,\"lineId\":\"line_0_19_J0qZDwiXf3e0\",\"objType\":\"textLine\",\"objPos\":[1213,275,41,237]},{\"lineNo\":20,\"lineEndIndex\":566,\"objContent\":\"复核人：\",\"lineStartIndex\":561,\"lineId\":\"line_0_20_J0qZDwiX0319\",\"objType\":\"textLine\",\"objPos\":[1290,272,35,117]},{\"lineNo\":21,\"lineEndIndex\":574,\"objContent\":\"刘洁杰\",\"lineStartIndex\":569,\"lineId\":\"line_0_21_JKqZDwiX1ebb\",\"objType\":\"textLine\",\"objPos\":[1306,439,35,106]},{\"lineNo\":22,\"lineEndIndex\":579,\"objContent\":\"村商业品\",\"lineStartIndex\":574,\"lineId\":\"line_0_22_JUqZDwiX014e\",\"objType\":\"textLine\",\"objPos\":[1325,979,38,72]},{\"lineNo\":23,\"lineEndIndex\":583,\"objContent\":\"为\",\"lineStartIndex\":579,\"lineId\":\"line_0_23_JoqZDwiX51bd\",\"objType\":\"textLine\",\"objPos\":[1318,1161,25,25]},{\"lineNo\":24,\"lineEndIndex\":594,\"objContent\":\"福\",\"lineStartIndex\":592,\"lineId\":\"line_0_24_JyqZDwiX8bf1\",\"objType\":\"textLine\",\"objPos\":[1348,983,10,21]},{\"lineNo\":25,\"lineEndIndex\":589,\"objContent\":\"审核签发人：\",\"lineStartIndex\":583,\"lineId\":\"line_0_25_JyqZDwiXe4b1\",\"objType\":\"textLine\",\"objPos\":[1362,272,30,176]},{\"lineNo\":26,\"lineEndIndex\":606,\"objContent\":\"万俊\",\"lineStartIndex\":604,\"lineId\":\"line_0_26_J8qZDwiX11b0\",\"objType\":\"textLine\",\"objPos\":[1376,486,41,99]},{\"lineNo\":27,\"lineEndIndex\":598,\"objContent\":\"EI双\",\"lineStartIndex\":594,\"lineId\":\"line_0_27_JSqZDwiX61b7\",\"objType\":\"textLine\",\"objPos\":[1372,966,17,51]},{\"lineNo\":28,\"lineEndIndex\":592,\"objContent\":\"通\",\"lineStartIndex\":589,\"lineId\":\"line_0_28_JmqZDwiX8601\",\"objType\":\"textLine\",\"objPos\":[1403,963,22,56]},{\"lineNo\":29,\"lineEndIndex\":604,\"objContent\":\"97\",\"lineStartIndex\":598,\"lineId\":\"line_0_29_JmqZDwiX393f\",\"objType\":\"textLine\",\"objPos\":[1404,1176,19,37]},{\"lineNo\":30,\"lineEndIndex\":613,\"objContent\":\"金融市场部\",\"lineStartIndex\":606,\"lineId\":\"line_0_30_JmqZDwiX4b06\",\"objType\":\"textLine\",\"objPos\":[1434,1007,64,173]},{\"lineNo\":31,\"lineEndIndex\":618,\"objContent\":\"密押（可选）：\",\"lineStartIndex\":613,\"lineId\":\"line_0_31_JwqZDwiXf01b\",\"objType\":\"textLine\",\"objPos\":[1500,265,31,191]},{\"lineNo\":32,\"lineEndIndex\":635,\"objContent\":\"托管银行\",\"lineStartIndex\":618,\"lineId\":\"line_0_32_JwqZDwiX3496\",\"objType\":\"textLine\",\"objPos\":[1583,258,35,132]},{\"lineNo\":33,\"lineEndIndex\":640,\"objContent\":\"托管银行确认理财资金运用划款指令\",\"lineStartIndex\":635,\"lineId\":\"line_0_33_JwqZDwiXef9a\",\"objType\":\"textLine\",\"objPos\":[1613,846,30,542]},{\"lineNo\":34,\"lineEndIndex\":646,\"objContent\":\"经办人：\",\"lineStartIndex\":640,\"lineId\":\"line_0_34_JwqZDwiX4b9b\",\"objType\":\"textLine\",\"objPos\":[1653,254,35,113]},{\"lineNo\":35,\"lineEndIndex\":651,\"objContent\":\"已经执行。\",\"lineStartIndex\":646,\"lineId\":\"line_0_35_J6qZDwiX0fbe\",\"objType\":\"textLine\",\"objPos\":[1666,815,33,144]},{\"lineNo\":36,\"lineEndIndex\":664,\"objContent\":\"复核人：\",\"lineStartIndex\":651,\"lineId\":\"line_0_36_JGqZDwiX0b08\",\"objType\":\"textLine\",\"objPos\":[1722,253,39,113]},{\"lineNo\":37,\"lineEndIndex\":669,\"objContent\":\"签章（资金清算专用章）\",\"lineStartIndex\":664,\"lineId\":\"line_0_37_JQqZDwiXc400\",\"objType\":\"textLine\",\"objPos\":[1738,839,29,361]},{\"lineNo\":38,\"lineEndIndex\":752,\"objContent\":\"审批人：\",\"lineStartIndex\":748,\"lineId\":\"line_0_38_J2qZDwiX4ab8\",\"objType\":\"textLine\",\"objPos\":[1793,250,35,110]},{\"lineNo\":39,\"lineEndIndex\":753,\"objContent\":\"2\",\"lineStartIndex\":752,\"lineId\":\"line_0_39_JMqZDwiX1b04\",\"objType\":\"textLine\",\"objPos\":[2359,772,22,12]}]}]}]";
        String rawText0 = "关于南昌农商银行百福理财聚福宝系列理财产品A款的:申购赎回说明:兴业银行资产托管部：:鉴于我行发行且在贵部托管的南昌农商银行百福理财聚福:宝系列理财产品A款已于2021年05月31日-06月02日进入开:放期，该次开放期的申购、赎回确认工作将在2021年06月03:日进行确认。现将本次开放期内的申购、赎回情况说明如下：:1、本次开放期共接受产品申购申请25，493,000.00元；:2、本次开放期共接受产品续回申请30，411，198.36份，对:应续回金额应为30，411，198.36元:为确保产品正常兑付，请贵部从本理财托管户划付资金:30，411，198.36元至如下账户：:户名：南昌农村商业银行股份有限公司:账号：197700556155:开户行：中行东湖支行:大额行号：104421072641:XI行股分有银保股份有限公司附件四：理财产品理财资金运用划款指令2021年06月03日编号：付款户名：南昌农商银行百福理财聚:福宝系列001号理财产品:福宝系列001号理财产品:付款账号：31021419:收款账号：502010100100573383:开户行：广发证券股份有限公司慈溪:开户行：兴业银行南昌分行营业部:许山路证券营业部:大写金额：壹仟零壹拾万零捌佰肆拾:小写金额：10，100，840.50:元伍角整:用途及备注：证转银:管理人:管理人预留印鉴盖章处：:经办人：:徐问:限份有限:复核人：:刘洁杰:审核签发人:万俊:面:180:金融市场部:豆:密押（可选）:托管银行:托管银行确认理财资金运用划款指令:经办人：:已经执行。:复核人：:签章（资金清算专用章）：:审批人：:收款户名：南昌农商银行百福理财聚1附件四：理财产品理财资金运用划款指令2021年06月03日编号：！付款户名：南昌农商银行百福理财聚收款户名：南昌农村商业银行股份有福宝系列001号理财产品限公司:付款账号：502010100100573383:收款账号：197700556155:开户行：兴业银行南昌分行营业部:开户行：中国银行南昌市东湖支行:大写金额：叁仟零肆拾壹万壹仟壹佰小写金额：30，411，198.36玖拾捌元叁角陆分用途及备注：理财赎回管理人管理人预留印鉴盖章处：经办人：徐司复核人：刘洁杰村商业品为福审核签发人：万俊EI双通97金融市场部密押（可选）：托管银行托管银行确认理财资金运用划款指令经办人：已经执行。复核人：签章（资金清算专用章）审批人：2。";
        TaskElementVO.DrawResultVO ObjectNew = TextUtils.correctPosInfoByIndex(object, 6, -1, fileTextStr, rawText0);
        System.out.println(ObjectNew);
    }

}
